pub trait BufferedIo {
type Frame;
type Error;
type Buffered<'a, const TX: usize, const RX: usize>
where Self: 'a;
// Required method
fn buffered<'a, const TX: usize, const RX: usize>(
&'a mut self,
tx: &'a mut [Self::Frame; TX],
rx: &'a mut [Self::Frame; RX],
) -> Self::Buffered<'a, TX, RX>;
}Expand description
Buffered I/O wrapper creation.
This trait is for drivers that support adding host-side ring buffers around an underlying CAN device. This is common when the hardware has small mailboxes, but the host wants to smooth bursty traffic.
Required Associated Types§
Required Methods§
Sourcefn buffered<'a, const TX: usize, const RX: usize>(
&'a mut self,
tx: &'a mut [Self::Frame; TX],
rx: &'a mut [Self::Frame; RX],
) -> Self::Buffered<'a, TX, RX>
fn buffered<'a, const TX: usize, const RX: usize>( &'a mut self, tx: &'a mut [Self::Frame; TX], rx: &'a mut [Self::Frame; RX], ) -> Self::Buffered<'a, TX, RX>
Wrap the interface with host-side TX/RX ring buffers.
The backing storage is provided by the caller to avoid allocation and to make buffer sizes explicit in types.
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.