embedded_hal_can

Trait Id

Source
pub trait Id {
    type BaseId;
    type ExtendedId;

    // Required methods
    fn base_id(&self) -> Option<Self::BaseId>;
    fn extended_id(&self) -> Option<Self::ExtendedId>;
}
Expand description

A type that can either be BaseId or ExtendedId

Required Associated Types§

Source

type BaseId

The (11-bit) BaseId variant.

Source

type ExtendedId

The (29-bit) ExtendedId variant.

Required Methods§

Source

fn base_id(&self) -> Option<Self::BaseId>

Returns Some(base_id) if this Can-ID is 11-bit. Returns None if this Can-ID is 29-bit.

Source

fn extended_id(&self) -> Option<Self::ExtendedId>

Returns Some(extended_id) if this Can-ID is 29-bit. Returns None if this Can-ID is 11-bit.

Implementors§