pub struct Frame { /* private fields */ }
Expand description
Frame with up to 8 bytes of data payload as per Classic(non-FD) CAN For CAN-FD support use FdFrame
Implementations§
source§impl Frame
impl Frame
sourcepub fn new(
can_header: Header,
raw_data: &[u8],
) -> Result<Self, FrameCreateError>
pub fn new( can_header: Header, raw_data: &[u8], ) -> Result<Self, FrameCreateError>
Create a new CAN classic Frame
sourcepub fn new_data(
id: impl Into<Id>,
data: &[u8],
) -> Result<Self, FrameCreateError>
pub fn new_data( id: impl Into<Id>, data: &[u8], ) -> Result<Self, FrameCreateError>
Creates a new data frame.
sourcepub fn new_extended(
raw_id: u32,
raw_data: &[u8],
) -> Result<Self, FrameCreateError>
pub fn new_extended( raw_id: u32, raw_data: &[u8], ) -> Result<Self, FrameCreateError>
Create new extended frame
sourcepub fn new_standard(
raw_id: u16,
raw_data: &[u8],
) -> Result<Self, FrameCreateError>
pub fn new_standard( raw_id: u16, raw_data: &[u8], ) -> Result<Self, FrameCreateError>
Create new standard frame
sourcepub fn new_remote(
id: impl Into<Id>,
len: usize,
) -> Result<Self, FrameCreateError>
pub fn new_remote( id: impl Into<Id>, len: usize, ) -> Result<Self, FrameCreateError>
Create new remote frame
Trait Implementations§
source§impl Frame for Frame
impl Frame for Frame
source§fn new_remote(id: impl Into<Id>, len: usize) -> Option<Self>
fn new_remote(id: impl Into<Id>, len: 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 Copy 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
)