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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more