pub struct BufferedCan<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> { /* private fields */ }
Expand description
Buffered CAN driver.
Implementations§
source§impl<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
impl<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
sourcepub fn writer(&self) -> BufferedCanSender
pub fn writer(&self) -> BufferedCanSender
Returns a sender that can be used for sending CAN frames.
sourcepub fn try_read(&mut self) -> Result<Envelope, TryReadError>
pub fn try_read(&mut self) -> Result<Envelope, TryReadError>
Attempts to read a CAN frame without blocking.
Returns [Err(TryReadError::Empty)] if there are no frames in the rx queue.
sourcepub async fn wait_not_empty(&mut self)
pub async fn wait_not_empty(&mut self)
Waits while receive queue is empty.
sourcepub fn reader(&self) -> BufferedCanReceiver
pub fn reader(&self) -> BufferedCanReceiver
Returns a receiver that can be used for receiving CAN frames. Note, each CAN frame will only be received by one receiver.
Auto Trait Implementations§
impl<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> Freeze for BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
impl<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> !RefUnwindSafe for BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
impl<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> !Send for BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
impl<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> !Sync for BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
impl<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> Unpin for BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
impl<'d, const TX_BUF_SIZE: usize, const RX_BUF_SIZE: usize> !UnwindSafe for BufferedCan<'d, TX_BUF_SIZE, RX_BUF_SIZE>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more