pub struct TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut>,{
buffer: BytesMut,
itmsg_allocator: BytesMut,
incoming: HashMap<u64, ITMessage>,
sink: S,
metrics: ProtocolMetricCache,
}
Expand description
TCP implementation of RecvProtocol
Fields§
§buffer: BytesMut
§itmsg_allocator: BytesMut
§incoming: HashMap<u64, ITMessage>
§sink: S
§metrics: ProtocolMetricCache
Implementations§
source§impl<S> TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut>,
impl<S> TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut>,
pub fn new(sink: S, metrics: ProtocolMetricCache) -> Self
Trait Implementations§
source§impl<S> Debug for TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut> + Debug,
impl<S> Debug for TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut> + Debug,
source§impl<S> RecvProtocol for TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut>,
impl<S> RecvProtocol for TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut>,
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 TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut>,
impl<S> ReliableSink for TcpRecvProtocol<S>where
S: UnreliableSink<DataFormat = BytesMut>,
Auto Trait Implementations§
impl<S> Freeze for TcpRecvProtocol<S>where
S: Freeze,
impl<S> !RefUnwindSafe for TcpRecvProtocol<S>
impl<S> Send for TcpRecvProtocol<S>
impl<S> Sync for TcpRecvProtocol<S>where
S: Sync,
impl<S> Unpin for TcpRecvProtocol<S>where
S: Unpin,
impl<S> !UnwindSafe for TcpRecvProtocol<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