Struct tor_rtmock::net::MockNetwork
source · [−]pub struct MockNetwork { /* private fields */ }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
sourceimpl MockNetwork
impl MockNetwork
sourcepub fn builder(self: &Arc<Self>) -> ProviderBuilder
pub fn builder(self: &Arc<Self>) -> ProviderBuilder
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
impl RefUnwindSafe for MockNetwork
impl Send for MockNetwork
impl Sync for MockNetwork
impl Unpin for MockNetwork
impl UnwindSafe for MockNetwork
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more