Enum embedded_can::Id
source · pub enum Id {
Standard(StandardId),
Extended(ExtendedId),
}
Expand description
A CAN Identifier (standard or extended).
Variants§
Standard(StandardId)
Standard 11-bit Identifier (0..=0x7FF
).
Extended(ExtendedId)
Extended 29-bit Identifier (0..=0x1FFF_FFFF
).
Trait Implementations§
source§impl From<ExtendedId> for Id
impl From<ExtendedId> for Id
source§fn from(id: ExtendedId) -> Self
fn from(id: ExtendedId) -> Self
source§impl From<StandardId> for Id
impl From<StandardId> for Id
source§fn from(id: StandardId) -> Self
fn from(id: StandardId) -> Self
source§impl Ord for Id
impl Ord for Id
Implement Ord
according to the CAN arbitration rules
When performing arbitration, frames are looked at bit for bit starting from the beginning. A bit with the value 0 is dominant and a bit with value of 1 is recessive.
When two devices are sending frames at the same time, as soon as the first bit is found which differs, the frame with the corresponding dominant 0 bit will win and get to send the rest of the frame.
This implementation of Ord
for Id
will take this into consideration
and when comparing two different instances of Id
the “smallest” will
always be the ID which would form the most dominant frame, all other
things being equal.
source§impl PartialOrd for Id
impl PartialOrd for Id
impl Copy for Id
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)