Struct netemul::TestFakeEndpoint
source · pub struct TestFakeEndpoint<'a> { /* private fields */ }
Expand description
A virtual fake network endpoint backed by Netemul.
Implementations§
source§impl<'a> TestFakeEndpoint<'a>
impl<'a> TestFakeEndpoint<'a>
Methods from Deref<Target = FakeEndpointProxy>§
sourcepub fn take_event_stream(&self) -> FakeEndpointEventStream
pub fn take_event_stream(&self) -> FakeEndpointEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
sourcepub fn read(&self) -> QueryResponseFut<(Vec<u8>, u64)>
pub fn read(&self) -> QueryResponseFut<(Vec<u8>, u64)>
Reads a single frame from the network.
Blocks until new data is available to be read. FakeEndpoint will keep a limited amount of
frames to be read, dropping the oldest ones if the data is not fetched fast enough. The
number of dropped frames since the last call to Read
is returned in dropped_frames
.
Issuing a second Read
request when the first one is still pending will cause the channel
to be closed with ZX_ERR_BAD_STATE
.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TestFakeEndpoint<'a>
impl<'a> !RefUnwindSafe for TestFakeEndpoint<'a>
impl<'a> Send for TestFakeEndpoint<'a>
impl<'a> Sync for TestFakeEndpoint<'a>
impl<'a> Unpin for TestFakeEndpoint<'a>
impl<'a> !UnwindSafe for TestFakeEndpoint<'a>
Blanket Implementations§
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§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>
§impl<T> IntoAny for T
impl<T> IntoAny for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.