Struct CanFrame

Source
pub struct CanFrame {
    pub id: u32,
    pub dlc: u8,
    pub data: [u8; 8],
    pub rtr: bool,
    pub ide: bool,
    pub reserved0: bool,
    pub reserved1: bool,
}
Expand description

A low level representation of the frames that might be sent and received on a CAN bus.

This struct can represent any CAN frame, as described in the CAN specification version 2.0, published September 1991 by Bosch GmbH. They can be used for either transmission or reception.

Fields§

§id: u32

This contains either the Base Identifier or the Extended Identifier, depending on ide.

§dlc: u8

Number of bytes in the payload.

§data: [u8; 8]

The frame’s data payload, only the first dlc bytes are valid.

§rtr: bool

True iff this frame is a Remote Transmission Request.

§ide: bool

True iff the id field is extended (ie 29 bits long, as opposed to 11).

§reserved0: bool

At the time of this writing this field isn’t specified, but it can be received as either value and subsequent protocols may end up using it.

§reserved1: bool

At the time of this writing this field isn’t specified, but it can be received as either value and subsequent protocols may end up using it.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.