Skip to main content

AsyncRxFrameIo

Trait AsyncRxFrameIo 

Source
pub trait AsyncRxFrameIo {
    type Frame;
    type Error;

    // Required methods
    async fn recv(&mut self) -> Result<Self::Frame, Self::Error>;
    async fn recv_timeout(
        &mut self,
        timeout: Duration,
    ) -> Result<Self::Frame, Self::Error>;
    async fn wait_not_empty(&mut self) -> Result<(), Self::Error>;
}
Expand description

Receive-side (async) CAN frame I/O.

This is the async equivalent of RxFrameIo.

Required Associated Types§

Source

type Frame

The CAN frame type.

Source

type Error

Error returned by the driver implementation.

Required Methods§

Source

async fn recv(&mut self) -> Result<Self::Frame, Self::Error>

Receive a frame asynchronously.

Source

async fn recv_timeout( &mut self, timeout: Duration, ) -> Result<Self::Frame, Self::Error>

Receive a frame asynchronously, waiting up to timeout.

Implementations that cannot support timeouts may treat this as AsyncRxFrameIo::recv.

Source

async fn wait_not_empty(&mut self) -> Result<(), Self::Error>

Asynchronously wait until the receive queue is non-empty.

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§