Skip to main content

AsyncTxFrameIo

Trait AsyncTxFrameIo 

Source
pub trait AsyncTxFrameIo {
    type Frame;
    type Error;

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

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

This is the async equivalent of TxFrameIo. It is intentionally small: protocol layers that need async I/O can build on top of it without depending on a specific async runtime.

Required Associated Types§

Source

type Frame

The CAN frame type.

Source

type Error

Error returned by the driver implementation.

Required Methods§

Source

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

Send a frame asynchronously.

Source

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

Send a frame asynchronously, waiting up to timeout.

Implementations that cannot support timeouts may treat this as AsyncTxFrameIo::send.

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§