pub trait CanDevice:
Send
+ Sync
+ TryFrom<DeviceBuilder<Self::Channel>, Error = Error> {
type Channel: Hash + Eq + 'static;
type Frame: Frame<Channel = Self::Channel>;
// Required methods
fn opened_channels(&self) -> Vec<Self::Channel>;
fn transmit<'life0, 'async_trait>(
&'life0 self,
msg: Self::Frame,
timeout: Option<u32>,
) -> Pin<Box<dyn Future<Output = CanResult<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn receive<'life0, 'async_trait>(
&'life0 self,
channel: Self::Channel,
timeout: Option<u32>,
) -> Pin<Box<dyn Future<Output = CanResult<Vec<Self::Frame>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown(&mut self);
// Provided method
fn is_closed(&self) -> bool { ... }
}Required Associated Types§
Required Methods§
Sourcefn opened_channels(&self) -> Vec<Self::Channel>
fn opened_channels(&self) -> Vec<Self::Channel>
get all channels that has opened
Sourcefn transmit<'life0, 'async_trait>(
&'life0 self,
msg: Self::Frame,
timeout: Option<u32>,
) -> Pin<Box<dyn Future<Output = CanResult<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn transmit<'life0, 'async_trait>(
&'life0 self,
msg: Self::Frame,
timeout: Option<u32>,
) -> Pin<Box<dyn Future<Output = CanResult<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transmit a CAN or CAN-FD Frame.
Provided Methods§
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.