pub struct LinuxCan { /* private fields */ }
Expand description

An adapter between SocketCAN and the canadensis frame format

Implementations§

source§

impl LinuxCan

source

pub fn new(socket: CANSocket) -> Self

Creates a Linux CAN adapter around a SocketCAN socket

Trait Implementations§

source§

impl ReceiveDriver<SystemClock> for LinuxCan

§

type Error = Error

The error type
source§

fn receive( &mut self, clock: &mut SystemClock ) -> Result<Frame<Microseconds64>, Self::Error>

Attempts to receive a frame without blocking
source§

fn apply_filters<S>(&mut self, local_node: Option<CanNodeId>, subscriptions: S)where S: IntoIterator<Item = Subscription>,

Sets up frame reception filters to accept only frames matching the provided subscriptions Read more
source§

fn apply_accept_all(&mut self)

Sets up frame reception filters to accept all incoming frames
source§

impl TransmitDriver<SystemClock> for LinuxCan

§

type Error = Error

The error type
source§

fn try_reserve(&mut self, _frames: usize) -> Result<(), OutOfMemoryError>

Attempts to reserve space to transmit frames additional frames Read more
source§

fn transmit( &mut self, frame: Frame<Microseconds64>, clock: &mut SystemClock ) -> Result<Option<Frame<Microseconds64>>, Self::Error>

Attempts to send a frame without blocking Read more
source§

fn flush(&mut self, _clock: &mut SystemClock) -> Result<(), Self::Error>

Attempts to flush all frames out of any in-memory queues that may exist and transmit them

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Err = <U as TryFrom<T>>::Err

§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>