pub struct MpscRecvProtocol<S>where
S: UnreliableSink<DataFormat = MpscMsg>,{
sink: S,
metrics: ProtocolMetricCache,
}
Expand description
MPSC implementation of RecvProtocol
Fields§
§sink: S
§metrics: ProtocolMetricCache
Implementations§
source§impl<S> MpscRecvProtocol<S>where
S: UnreliableSink<DataFormat = MpscMsg>,
impl<S> MpscRecvProtocol<S>where
S: UnreliableSink<DataFormat = MpscMsg>,
pub fn new(sink: S, metrics: ProtocolMetricCache) -> Self
Trait Implementations§
source§impl<S> Debug for MpscRecvProtocol<S>
impl<S> Debug for MpscRecvProtocol<S>
source§impl<S> RecvProtocol for MpscRecvProtocol<S>where
S: UnreliableSink<DataFormat = MpscMsg>,
impl<S> RecvProtocol for MpscRecvProtocol<S>where
S: UnreliableSink<DataFormat = MpscMsg>,
type CustomErr = <S as UnreliableSink>::CustomErr
source§fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<ProtocolEvent, ProtocolError<Self::CustomErr>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<ProtocolEvent, ProtocolError<Self::CustomErr>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Either recv an event or fail the Protocol, once the Recv side is closed
it cannot recover from the error.
source§impl<S> ReliableSink for MpscRecvProtocol<S>where
S: UnreliableSink<DataFormat = MpscMsg>,
impl<S> ReliableSink for MpscRecvProtocol<S>where
S: UnreliableSink<DataFormat = MpscMsg>,
Auto Trait Implementations§
impl<S> Freeze for MpscRecvProtocol<S>where
S: Freeze,
impl<S> !RefUnwindSafe for MpscRecvProtocol<S>
impl<S> Send for MpscRecvProtocol<S>
impl<S> Sync for MpscRecvProtocol<S>where
S: Sync,
impl<S> Unpin for MpscRecvProtocol<S>where
S: Unpin,
impl<S> !UnwindSafe for MpscRecvProtocol<S>
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> 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