[][src]Struct multican::CanMessage

pub struct CanMessage {
    pub header: u32,
    pub data: Vec<u8>,
    pub bus: u8,
}

Fields

header: u32

29 bit CAN header

data: Vec<u8>

Message payload

bus: u8

Bus index

Implementations

impl CanMessage[src]

pub fn dlc(&self) -> usize[src]

Gets the data length

pub fn sa(&self) -> u8[src]

Source address

pub fn da(&self) -> u8[src]

Destination address. Only valid if this message is destination specific

pub fn pgn(&self) -> u16[src]

Parameter group number

pub fn into_bytes(self) -> Vec<u8>[src]

Serializes a CAN message into a byte vector

pub fn from_bytes(bytes: &[u8]) -> CanMessage[src]

Deserializes a CAN message from bytes

Trait Implementations

impl Clone for CanMessage[src]

impl Debug for CanMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

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