pub struct ExtendedId { /* private fields */ }
Expand description
An extended 29 bit CAN ID.
Implementations§
Source§impl ExtendedId
impl ExtendedId
Sourcepub const fn new(id: u32) -> Result<Self, InvalidId>
pub const fn new(id: u32) -> Result<Self, InvalidId>
Try to create a new extended ID from a raw value.
Returns an error if the value doesn’t fit in 29 bits.
Sourcepub const fn from_u8(id: u8) -> Self
pub const fn from_u8(id: u8) -> Self
Create a new extended ID from a u8
.
Note that ExtendedId
also implements From<u8>
.
However, this function is usable in const
context.
Sourcepub const fn from_u16(id: u16) -> Self
pub const fn from_u16(id: u16) -> Self
Create a new extended ID from a u16
.
Note that ExtendedId
also implements From<u16>
.
However, this function is usable in const
context.
Sourcepub const fn as_u32(self) -> u32
pub const fn as_u32(self) -> u32
Get the raw value as a u32
.
Note that ExtendedId
also implements Into<u32>
.
However, this function is usable in const
context.
Sourcepub const unsafe fn new_unchecked(id: u32) -> Self
pub const unsafe fn new_unchecked(id: u32) -> Self
Create a new extended CAN ID without checking for validity.
§Safety
The given ID must be a valid extended CAN ID (id <= MAX_EXTENDED_ID
).
Trait Implementations§
Source§impl Clone for ExtendedId
impl Clone for ExtendedId
Source§fn clone(&self) -> ExtendedId
fn clone(&self) -> ExtendedId
Returns a duplicate 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 ExtendedId
impl Debug for ExtendedId
Source§impl From<CanId> for ExtendedId
impl From<CanId> for ExtendedId
Source§impl From<ExtendedId> for CanId
impl From<ExtendedId> for CanId
Source§fn from(value: ExtendedId) -> Self
fn from(value: ExtendedId) -> Self
Converts to this type from the input type.
Source§impl From<StandardId> for ExtendedId
impl From<StandardId> for ExtendedId
Source§fn from(value: StandardId) -> Self
fn from(value: StandardId) -> Self
Converts to this type from the input type.
Source§impl From<u16> for ExtendedId
impl From<u16> for ExtendedId
Source§impl From<u8> for ExtendedId
impl From<u8> for ExtendedId
Source§impl FromStr for ExtendedId
impl FromStr for ExtendedId
Source§impl LowerHex for ExtendedId
impl LowerHex for ExtendedId
Source§impl Ord for ExtendedId
impl Ord for ExtendedId
Source§fn cmp(&self, other: &ExtendedId) -> Ordering
fn cmp(&self, other: &ExtendedId) -> 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<CanId> for ExtendedId
impl PartialEq<CanId> for ExtendedId
Source§impl PartialEq<ExtendedId> for CanId
impl PartialEq<ExtendedId> for CanId
Source§impl PartialEq for ExtendedId
impl PartialEq for ExtendedId
Source§impl PartialOrd for ExtendedId
impl PartialOrd for ExtendedId
Source§impl TryFrom<ExtendedId> for StandardId
impl TryFrom<ExtendedId> for StandardId
Source§impl TryFrom<u32> for ExtendedId
impl TryFrom<u32> for ExtendedId
Source§impl UpperHex for ExtendedId
impl UpperHex for ExtendedId
impl Copy for ExtendedId
impl Eq for ExtendedId
impl StructuralPartialEq for ExtendedId
Auto Trait Implementations§
impl Freeze for ExtendedId
impl RefUnwindSafe for ExtendedId
impl Send for ExtendedId
impl Sync for ExtendedId
impl Unpin for ExtendedId
impl UnwindSafe for ExtendedId
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