pub struct TestTransport { /* private fields */ }Available on (crate features
test-utils) and crate feature unstable-custom-transports only.Expand description
A test transport for use with TestNetwork.
Implements CustomTransport and CustomEndpoint for testing.
Trait Implementations§
Source§impl Clone for TestTransport
impl Clone for TestTransport
Source§fn clone(&self) -> TestTransport
fn clone(&self) -> TestTransport
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CustomEndpoint for TestTransport
impl CustomEndpoint for TestTransport
Source§fn watch_local_addrs(&self) -> Direct<Vec<CustomAddr>>
fn watch_local_addrs(&self) -> Direct<Vec<CustomAddr>>
A watcher for local addresses for this custom endpoint.
Source§fn create_sender(&self) -> Arc<dyn CustomSender>
fn create_sender(&self) -> Arc<dyn CustomSender>
Create a custom sender for this custom endpoint.
Source§fn poll_recv(
&mut self,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>],
metas: &mut [RecvMeta],
recv_infos: &mut [RecvInfo],
) -> Poll<Result<usize>>
fn poll_recv( &mut self, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>], metas: &mut [RecvMeta], recv_infos: &mut [RecvInfo], ) -> Poll<Result<usize>>
poll receiving a packet on this custom endpoint. Read more
Source§fn max_transmit_segments(&self) -> NonZeroUsize
fn max_transmit_segments(&self) -> NonZeroUsize
Maximum number of segments to transmit (GSO). Read more
Source§impl CustomTransport for TestTransport
impl CustomTransport for TestTransport
Auto Trait Implementations§
impl Freeze for TestTransport
impl RefUnwindSafe for TestTransport
impl Send for TestTransport
impl Sync for TestTransport
impl Unpin for TestTransport
impl UnwindSafe for TestTransport
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more