[go: up one dir, main page]

Struct tor_rtmock::net::MockNetwork[][src]

pub struct MockNetwork { /* fields omitted */ }
Expand description

A simulated Internet, for testing.

We simulate TCP streams only, and skip all the details. Connection are implemented using LocalStream. The MockNetwork object is shared by a large set of MockNetworkProviders, each of which has its own view of its address(es) on the network.

Implementations

Make a new MockNetwork with no active listeners.

Return a ProviderBuilder for creating a MockNetProvider

Examples
let client_net = mock_network.builder()
      .add_address("198.51.100.6".parse().unwrap())
      .add_address("2001:db8::7".parse().unwrap())
      .provider();

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.