Skip to main content

CotpReader

Trait CotpReader 

Source
pub trait CotpReader: Send {
    // Required method
    fn recv(
        &mut self,
    ) -> impl Future<Output = Result<Option<Vec<u8>>, CotpError>> + Send;
}
Expand description

A trait representing the read half of COTP connection.

Required Methods§

Source

fn recv( &mut self, ) -> impl Future<Output = Result<Option<Vec<u8>>, CotpError>> + Send

Reads from a COTP connection. There are three outcomes.

  • Some(data) - Data was read.
  • None - The underlying connection was closed normally.
  • TpktError - May indicate a packet was malformed, there was an IO error or some other internal failure occurred.

This operation is cancel safe.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§