Enum can_socket::CanId
source · #[repr(C)]pub enum CanId {
Base(CanBaseId),
Extended(CanExtendedId),
}
Variants§
Base(CanBaseId)
Extended(CanExtendedId)
Implementations§
source§impl CanId
impl CanId
pub fn new(id: u32) -> Result<Self, InvalidId>
pub fn new_base(id: u16) -> Result<Self, InvalidId>
pub fn new_extended(id: u32) -> Result<Self, InvalidId>
pub fn as_u32(self) -> u32
pub fn as_base(self) -> Option<CanBaseId>
pub fn as_extended(self) -> Option<CanExtendedId>
pub fn to_base(self) -> Result<CanBaseId, InvalidId>
pub fn to_extended(self) -> CanExtendedId
Trait Implementations§
source§impl From<CanExtendedId> for CanId
impl From<CanExtendedId> for CanId
source§fn from(value: CanExtendedId) -> Self
fn from(value: CanExtendedId) -> Self
Converts to this type from the input type.
source§impl From<CanId> for CanExtendedId
impl From<CanId> for CanExtendedId
source§impl Ord for CanId
impl Ord for CanId
source§impl PartialEq<CanBaseId> for CanId
impl PartialEq<CanBaseId> for CanId
source§impl PartialEq<CanExtendedId> for CanId
impl PartialEq<CanExtendedId> for CanId
source§fn eq(&self, other: &CanExtendedId) -> bool
fn eq(&self, other: &CanExtendedId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<CanId> for CanBaseId
impl PartialEq<CanId> for CanBaseId
source§impl PartialEq<CanId> for CanExtendedId
impl PartialEq<CanId> for CanExtendedId
source§impl PartialEq for CanId
impl PartialEq for CanId
source§impl PartialOrd for CanId
impl PartialOrd for CanId
1.0.0 · source§fn 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 CanId
impl Eq for CanId
impl StructuralPartialEq for CanId
Auto Trait Implementations§
impl Freeze for CanId
impl RefUnwindSafe for CanId
impl Send for CanId
impl Sync for CanId
impl Unpin for CanId
impl UnwindSafe for CanId
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