Struct embedded_can::StandardId
source · [−]pub struct StandardId(_);
Expand description
Standard 11-bit CAN Identifier (0..=0x7FF
).
Implementations
sourceimpl StandardId
impl StandardId
sourcepub const fn new(raw: u16) -> Option<Self>
pub const fn new(raw: u16) -> Option<Self>
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) -> Self
pub const unsafe fn new_unchecked(raw: u16) -> Self
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
sourceimpl Clone for StandardId
impl Clone for StandardId
sourcefn clone(&self) -> StandardId
fn clone(&self) -> StandardId
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 StandardId
impl Debug for StandardId
sourceimpl From<StandardId> for Id
impl From<StandardId> for Id
sourcefn from(id: StandardId) -> Self
fn from(id: StandardId) -> Self
Converts to this type from the input type.
sourceimpl Hash for StandardId
impl Hash for StandardId
sourceimpl Ord for StandardId
impl Ord for StandardId
sourcefn cmp(&self, other: &StandardId) -> Ordering
fn cmp(&self, other: &StandardId) -> 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<StandardId> for StandardId
impl PartialEq<StandardId> for StandardId
sourcefn eq(&self, other: &StandardId) -> bool
fn eq(&self, other: &StandardId) -> bool
sourceimpl PartialOrd<StandardId> for StandardId
impl PartialOrd<StandardId> for StandardId
sourcefn partial_cmp(&self, other: &StandardId) -> Option<Ordering>
fn partial_cmp(&self, other: &StandardId) -> 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 StandardId
impl Eq for StandardId
impl StructuralEq for StandardId
impl StructuralPartialEq for StandardId
Auto Trait Implementations
impl RefUnwindSafe for StandardId
impl Send for StandardId
impl Sync for StandardId
impl Unpin for StandardId
impl UnwindSafe for StandardId
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