Skip to main content

Raw

Trait Raw 

Source
pub trait Raw {
    // Required methods
    fn id(&self) -> Id;
    fn decoded_dlc(&self) -> usize;
    fn dlc(&self) -> u8;
    fn fd_format(&self) -> bool;
    fn is_remote_frame(&self) -> bool;
    fn data(&self) -> &[u8];
    fn is_extended(&self) -> bool;
    fn is_transmitter_error_passive(&self) -> bool;
    fn bit_rate_switching(&self) -> bool;
}
Expand description

Common functionality for all raw messages. This is a trait instead of directly associated methods to allow the message size to be erased.

Required Methods§

Source

fn id(&self) -> Id

Returns the CAN identifier of the message

Source

fn decoded_dlc(&self) -> usize

Data length in bytes

Source

fn dlc(&self) -> u8

Data length code

Source

fn fd_format(&self) -> bool

True if the header indicates that the frame uses the CAN FD format

Source

fn is_remote_frame(&self) -> bool

Remote Transmission Request

Source

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

Data field

Source

fn is_extended(&self) -> bool

Check if the frame uses and extended (29-bit) ID

Source

fn is_transmitter_error_passive(&self) -> bool

true if the sender of the message indicates that it is in “error passive” state.

Source

fn bit_rate_switching(&self) -> bool

true if bit rate switching is used

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Raw for TxEvent

Source§

impl<const N: usize> Raw for mcan::message::rx::Message<N>

Source§

impl<const N: usize> Raw for mcan::message::tx::Message<N>