Struct automotive::async_can::AsyncCanAdapter
source · pub struct AsyncCanAdapter { /* private fields */ }
Expand description
Async wrapper around a CanAdapter
. Starts a background thread to handle sending and receiving frames. Uses tokio channels to communicate with the background thread.
Implementations§
source§impl AsyncCanAdapter
impl AsyncCanAdapter
pub fn new<T: CanAdapter + Send + Sync + 'static>(adapter: T) -> Self
sourcepub async fn send(&self, frame: &Frame)
pub async fn send(&self, frame: &Frame)
Send a single frame. The Future will resolve once the frame has been put in the queue for the background thread. This does not mean the frame is sent out by the adapter.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncCanAdapter
impl Send for AsyncCanAdapter
impl Sync for AsyncCanAdapter
impl Unpin for AsyncCanAdapter
impl !UnwindSafe for AsyncCanAdapter
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