pub struct Frame { /* private fields */ }
Expand description
A CAN data or remote frame.
Implementations
sourceimpl Frame
impl Frame
sourcepub fn new_remote(id: impl Into<Id>, dlc: u8) -> Self
pub fn new_remote(id: impl Into<Id>, dlc: u8) -> Self
Creates a new remote frame with configurable data length code (DLC).
Panics
This function will panic if dlc
is not inside the valid range 0..=8
.
sourcepub fn is_extended(&self) -> bool
pub fn is_extended(&self) -> bool
Returns true if this frame is an extended frame.
sourcepub fn is_standard(&self) -> bool
pub fn is_standard(&self) -> bool
Returns true if this frame is a standard frame.
sourcepub fn is_remote_frame(&self) -> bool
pub fn is_remote_frame(&self) -> bool
Returns true if this frame is a remote frame.
sourcepub fn is_data_frame(&self) -> bool
pub fn is_data_frame(&self) -> bool
Returns true if this frame is a data frame.
sourcepub fn priority(&self) -> FramePriority
pub fn priority(&self) -> FramePriority
Returns the priority of this frame.
Trait Implementations
sourceimpl Frame for Frame
impl Frame for Frame
sourcefn new_remote(id: impl Into<Id>, dlc: usize) -> Option<Self>
fn new_remote(id: impl Into<Id>, dlc: usize) -> Option<Self>
Creates a new remote frame (RTR bit set). Read more
sourcefn is_extended(&self) -> bool
fn is_extended(&self) -> bool
Returns true if this frame is a extended frame.
sourcefn is_remote_frame(&self) -> bool
fn is_remote_frame(&self) -> bool
Returns true if this frame is a remote frame.
sourcefn dlc(&self) -> usize
fn dlc(&self) -> usize
Returns the data length code (DLC) which is in the range 0..8. Read more
sourcefn is_standard(&self) -> bool
fn is_standard(&self) -> bool
Returns true if this frame is a standard frame.
sourcefn is_data_frame(&self) -> bool
fn is_data_frame(&self) -> bool
Returns true if this frame is a data frame.
impl Eq for Frame
impl StructuralEq for Frame
Auto Trait Implementations
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnwindSafe for Frame
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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