pub struct NetworkEventReceiver<M> { /* private fields */ }Expand description
Receiving side of the engine’s event channel.
There is exactly one receiver per engine; it is returned from
crate::NetworkEngine::start. The underlying channel is bounded, so the
application should consume events promptly to avoid back-pressuring the
engine.
Implementations§
Source§impl<M> NetworkEventReceiver<M>
impl<M> NetworkEventReceiver<M>
Sourcepub async fn recv(&mut self) -> Option<NetworkEvent<M>>
pub async fn recv(&mut self) -> Option<NetworkEvent<M>>
Receives the next event.
Returns None after the engine has shut down and all pending events
have been consumed.
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for NetworkEventReceiver<M>
impl<M> RefUnwindSafe for NetworkEventReceiver<M>
impl<M> Send for NetworkEventReceiver<M>
impl<M> Sync for NetworkEventReceiver<M>
impl<M> Unpin for NetworkEventReceiver<M>
impl<M> UnsafeUnpin for NetworkEventReceiver<M>
impl<M> UnwindSafe for NetworkEventReceiver<M>
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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