Struct socketcan::frame::CanDataFrame
source · pub struct CanDataFrame(/* private fields */);
Expand description
The classic CAN 2.0 frame with up to 8-bytes of data.
This is highly compatible with the can_frame
from libc.
(ref)
Trait Implementations§
source§impl AsPtr for CanDataFrame
impl AsPtr for CanDataFrame
source§impl AsRef<can_frame> for CanDataFrame
impl AsRef<can_frame> for CanDataFrame
source§impl Clone for CanDataFrame
impl Clone for CanDataFrame
source§fn clone(&self) -> CanDataFrame
fn clone(&self) -> CanDataFrame
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CanDataFrame
impl Debug for CanDataFrame
source§impl Default for CanDataFrame
impl Default for CanDataFrame
source§impl Frame for CanDataFrame
impl Frame for CanDataFrame
source§fn set_data(&mut self, data: &[u8]) -> Result<(), ConstructionError>
fn set_data(&mut self, data: &[u8]) -> Result<(), ConstructionError>
Sets the data payload of the frame.
source§fn from_raw_id(id: u32, data: &[u8]) -> Option<Self>
fn from_raw_id(id: u32, data: &[u8]) -> Option<Self>
Creates a frame using a raw, integer CAN ID. Read more
source§fn remote_from_raw_id(id: u32, dlc: usize) -> Option<Self>
fn remote_from_raw_id(id: u32, dlc: usize) -> Option<Self>
Creates a remote frame using a raw, integer CAN ID. Read more
source§fn is_error_frame(&self) -> bool
fn is_error_frame(&self) -> bool
Check if frame is an error message
source§impl Frame for CanDataFrame
impl Frame for CanDataFrame
source§fn new_remote(_id: impl Into<Id>, _dlc: usize) -> Option<Self>
fn new_remote(_id: impl Into<Id>, _dlc: usize) -> Option<Self>
Create a new remote transmission request frame.
source§fn is_extended(&self) -> bool
fn is_extended(&self) -> bool
Check if frame uses 29-bit extended ID format.
source§fn is_remote_frame(&self) -> bool
fn is_remote_frame(&self) -> bool
Check if frame is a remote transmission request.
source§fn data(&self) -> &[u8] ⓘ
fn data(&self) -> &[u8] ⓘ
A slice into the actual data. Slice will always be <= 8 bytes in length
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.
source§impl From<CanDataFrame> for CanFdFrame
impl From<CanDataFrame> for CanFdFrame
source§fn from(frame: CanDataFrame) -> Self
fn from(frame: CanDataFrame) -> Self
Converts to this type from the input type.
source§impl From<CanDataFrame> for CanFrame
impl From<CanDataFrame> for CanFrame
source§fn from(frame: CanDataFrame) -> Self
fn from(frame: CanDataFrame) -> Self
Create a CanFrame
from a data frame
source§impl TryFrom<CanFdFrame> for CanDataFrame
impl TryFrom<CanFdFrame> for CanDataFrame
§type Error = ConstructionError
type Error = ConstructionError
The type returned in the event of a conversion error.
source§impl TryFrom<can_frame> for CanDataFrame
impl TryFrom<can_frame> for CanDataFrame
source§impl UpperHex for CanDataFrame
impl UpperHex for CanDataFrame
impl Copy for CanDataFrame
Auto Trait Implementations§
impl RefUnwindSafe for CanDataFrame
impl Send for CanDataFrame
impl Sync for CanDataFrame
impl Unpin for CanDataFrame
impl UnwindSafe for CanDataFrame
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> ControllerSpecificErrorInformation for Twhere
T: Frame,
impl<T> ControllerSpecificErrorInformation for Twhere T: Frame,
source§fn get_ctrl_err(&self) -> Option<&[u8]>
fn get_ctrl_err(&self) -> Option<&[u8]>
Get the controller specific error information.