pub struct StandardId(/* private fields */);
Expand description
Standard 11-bit CAN Identifier (0..=0x7FF
).
Implementations§
Source§impl StandardId
impl StandardId
Sourcepub const ZERO: StandardId = _
pub const ZERO: StandardId = _
CAN ID 0
, the highest priority.
Sourcepub const MAX: StandardId = _
pub const MAX: StandardId = _
CAN ID 0x7FF
, the lowest priority.
Sourcepub const fn new(raw: u16) -> Option<StandardId>
pub const 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.
Source§impl Hash for StandardId
impl Hash for StandardId
Source§impl Ord for StandardId
impl Ord for StandardId
Source§fn cmp(&self, other: &StandardId) -> Ordering
fn cmp(&self, other: &StandardId) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StandardId
impl PartialEq for StandardId
Source§impl PartialOrd for StandardId
impl PartialOrd for StandardId
impl Copy for StandardId
impl Eq for StandardId
impl StructuralPartialEq for StandardId
Auto Trait Implementations§
impl Freeze for StandardId
impl RefUnwindSafe for StandardId
impl Send for StandardId
impl Sync for StandardId
impl Unpin for StandardId
impl UnwindSafe for StandardId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more