pub struct Frame { /* private fields */ }
Expand description
A CAN data or remote frame.
Implementations§
source§impl 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§
source§impl Frame for Frame
impl Frame for Frame
source§fn 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
source§fn is_extended(&self) -> bool
fn is_extended(&self) -> bool
Returns true if this frame is a extended frame.
source§fn is_remote_frame(&self) -> bool
fn is_remote_frame(&self) -> bool
Returns true if this frame is a remote frame.
source§fn dlc(&self) -> usize
fn dlc(&self) -> usize
Returns the data length code (DLC) which is in the range 0..8. Read more
source§fn is_standard(&self) -> bool
fn is_standard(&self) -> bool
Returns true if this frame is a standard frame.
source§fn is_data_frame(&self) -> bool
fn is_data_frame(&self) -> bool
Returns true if this frame is a data frame.
impl Eq for Frame
Auto Trait Implementations§
impl Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnwindSafe for Frame
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)