embedded_hal_can

Trait Frame

Source
pub trait Frame {
    type Id: Id;

    // Required methods
    fn is_remote_frame(&self) -> bool;
    fn is_data_frame(&self) -> bool;
    fn id(&self) -> Self::Id;
    fn data(&self) -> Option<&[u8]>;

    // Provided methods
    fn is_base_id_frame(&self) -> bool { ... }
    fn is_extended_id_frame(&self) -> bool { ... }
}
Expand description

A Can Frame

Required Associated Types§

Source

type Id: Id

The Id type of this Frame

Required Methods§

Source

fn is_remote_frame(&self) -> bool

Returns true if this Frame is a remote frame

Source

fn is_data_frame(&self) -> bool

Returns true if this Frame is a data frame

Source

fn id(&self) -> Self::Id

Returns the Can-ID

Source

fn data(&self) -> Option<&[u8]>

Returns Some(Data) if data frame. Returns None if remote frame.

Provided Methods§

Source

fn is_base_id_frame(&self) -> bool

Returns true if this Frame is a extended id frame

Source

fn is_extended_id_frame(&self) -> bool

Returns true if this Frame is a extended id frame

Implementors§