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