Struct nucleo_f401re::hal::can::StandardId
source · pub struct StandardId(_);
Expand description
Standard 11-bit CAN Identifier (0..=0x7FF
).
Implementations§
source§impl StandardId
impl StandardId
sourcepub const ZERO: StandardId = StandardId(0)
pub const ZERO: StandardId = StandardId(0)
CAN ID 0
, the highest priority.
sourcepub const MAX: StandardId = StandardId(2047)
pub const MAX: StandardId = StandardId(2047)
CAN ID 0x7FF
, the lowest priority.
sourcepub fn new(raw: u16) -> Option<StandardId>
pub fn new(raw: u16) -> Option<StandardId>
Tries to create a StandardId
from a raw 16-bit integer.
This will return None
if raw
is out of range of an 11-bit integer (> 0x7FF
).
sourcepub const unsafe fn new_unchecked(raw: u16) -> StandardId
pub const unsafe fn new_unchecked(raw: u16) -> StandardId
Creates a new StandardId
without checking if it is inside the valid range.
Safety
Using this method can create an invalid ID and is thus marked as unsafe.
Trait Implementations§
source§impl Clone for StandardId
impl Clone for StandardId
source§fn clone(&self) -> StandardId
fn clone(&self) -> StandardId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for StandardId
impl Debug for StandardId
source§impl From<StandardId> for Id
impl From<StandardId> for Id
source§fn from(id: StandardId) -> Id
fn from(id: StandardId) -> Id
Converts to this type from the input type.