pub enum CanId {
Standard(u16),
Extended(u32),
}Variants§
Implementations§
Source§impl Id
impl Id
pub fn new_standard(id: u16) -> Self
pub fn new_extended(id: u32) -> Self
Sourcepub fn from_bits(id: u32, force_extend: Option<bool>) -> Self
pub fn from_bits(id: u32, force_extend: Option<bool>) -> Self
Return Id::Extended if force_extend is Some(true)
or IdentifierFlags::EXTENDED bit is set
or id value rather than SFF_MASK
else Id::Standard
Sourcepub fn from_hex(hex_str: &str, force_extend: Option<bool>) -> Option<Self>
pub fn from_hex(hex_str: &str, force_extend: Option<bool>) -> Option<Self>
Parse from a hex string.
Sourcepub fn standard_id(self) -> Self
pub fn standard_id(self) -> Self
Returns the Base ID part of this extended identifier.
Sourcepub fn is_extended(&self) -> bool
pub fn is_extended(&self) -> bool
Return true if Id is extended else false
Trait Implementations§
Source§impl From<u32> for Id
impl From<u32> for Id
Source§fn from(id: u32) -> Self
fn from(id: u32) -> Self
Return Id::Extended if IdentifierFlags::EXTENDED bit is set
or id value rather than SFF_MASK else Id::Standard
impl Copy for Id
impl Eq for Id
impl Send for Id
impl StructuralPartialEq for Id
impl Sync for Id
Auto Trait Implementations§
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