Trait WireRx

Source
pub trait WireRx {
    type Error: AsWireRxErrorKind;

    // Required method
    async fn receive<'a>(
        &mut self,
        buf: &'a mut [u8],
    ) -> Result<&'a mut [u8], Self::Error>;
}
Expand description

This trait defines how to receive a single frame from a client

Required Associated Types§

Source

type Error: AsWireRxErrorKind

The error type of this connection.

For simple cases, you can use WireRxErrorKind directly. You can also use your own custom type that implements AsWireRxErrorKind.

Required Methods§

Source

async fn receive<'a>( &mut self, buf: &'a mut [u8], ) -> Result<&'a mut [u8], Self::Error>

Receive a single frame

On success, the portion of buf that contains a single frame is returned.

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§