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§
Required Methods§
Sourceasync fn send(&mut self, frame: &Self::Frame) -> Result<(), Self::Error>
async fn send(&mut self, frame: &Self::Frame) -> Result<(), Self::Error>
Send a frame asynchronously.
Sourceasync fn send_timeout(
&mut self,
frame: &Self::Frame,
timeout: Duration,
) -> Result<(), Self::Error>
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.