Struct embedded_can::ExtendedId
source · [−]pub struct ExtendedId(_);
Expand description
Extended 29-bit CAN Identifier (0..=1FFF_FFFF
).
Implementations
sourceimpl ExtendedId
impl ExtendedId
sourcepub const fn new(raw: u32) -> Option<Self>
pub const fn new(raw: u32) -> Option<Self>
Tries to create a ExtendedId
from a raw 32-bit integer.
This will return None
if raw
is out of range of an 29-bit integer (> 0x1FFF_FFFF
).
sourcepub const unsafe fn new_unchecked(raw: u32) -> Self
pub const unsafe fn new_unchecked(raw: u32) -> Self
Creates a new ExtendedId
without checking if it is inside the valid range.
Safety
Using this method can create an invalid ID and is thus marked as unsafe.
sourcepub fn standard_id(&self) -> StandardId
pub fn standard_id(&self) -> StandardId
Returns the Base ID part of this extended identifier.
Trait Implementations
sourceimpl Clone for ExtendedId
impl Clone for ExtendedId
sourcefn clone(&self) -> ExtendedId
fn clone(&self) -> ExtendedId
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ExtendedId
impl Debug for ExtendedId
sourceimpl From<ExtendedId> for Id
impl From<ExtendedId> for Id
sourcefn from(id: ExtendedId) -> Self
fn from(id: ExtendedId) -> Self
Converts to this type from the input type.
sourceimpl Hash for ExtendedId
impl Hash for ExtendedId
sourceimpl Ord for ExtendedId
impl Ord for ExtendedId
sourcefn cmp(&self, other: &ExtendedId) -> Ordering
fn cmp(&self, other: &ExtendedId) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<ExtendedId> for ExtendedId
impl PartialEq<ExtendedId> for ExtendedId
sourcefn eq(&self, other: &ExtendedId) -> bool
fn eq(&self, other: &ExtendedId) -> bool
sourceimpl PartialOrd<ExtendedId> for ExtendedId
impl PartialOrd<ExtendedId> for ExtendedId
sourcefn partial_cmp(&self, other: &ExtendedId) -> Option<Ordering>
fn partial_cmp(&self, other: &ExtendedId) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for ExtendedId
impl Eq for ExtendedId
impl StructuralEq for ExtendedId
impl StructuralPartialEq for ExtendedId
Auto Trait Implementations
impl RefUnwindSafe for ExtendedId
impl Send for ExtendedId
impl Sync for ExtendedId
impl Unpin for ExtendedId
impl UnwindSafe for ExtendedId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more