Skip to main content

RecvProtocol

Trait RecvProtocol 

Source
pub trait RecvProtocol {
    type CustomErr: Debug + Send;

    // Required method
    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;
}
Expand description

Generic Network Recv Protocol. See: SendProtocol

Required Associated Types§

Required Methods§

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,

Either recv an event or fail the Protocol, once the Recv side is closed it cannot recover from the error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§