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§fn as_ptr(&self) -> *const Self::Inner
fn as_ptr(&self) -> *const Self::Inner
Gets a pointer to the CAN frame structure that is compatible with the Linux C API.
Source§fn as_mut_ptr(&mut self) -> *mut Self::Inner
fn as_mut_ptr(&mut self) -> *mut Self::Inner
Gets a mutable pointer to the CAN frame structure that is compatible with the Linux C API.
Source§fn as_bytes_mut(&mut self) -> &[u8] ⓘ
fn as_bytes_mut(&mut self) -> &[u8] ⓘ
Gets a mutable byte slice to the inner type
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 duplicate 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 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 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 From<CanDataFrame> for CanAnyFrame
impl From<CanDataFrame> for CanAnyFrame
Source§fn from(frame: CanDataFrame) -> Self
fn from(frame: CanDataFrame) -> Self
Converts to this type from the input type.
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<CanAnyFrame> for CanDataFrame
impl TryFrom<CanAnyFrame> for CanDataFrame
Source§type Error = ConstructionError
type Error = ConstructionError
The type returned in the event of a conversion error.
Source§impl TryFrom<CanFdFrame> for CanDataFrame
impl TryFrom<CanFdFrame> for CanDataFrame
Source§type Error = ConstructionError
type Error = ConstructionError
The type returned in the event of a conversion error.
Source§impl TryFrom<CanFrame> for CanDataFrame
impl TryFrom<CanFrame> for CanDataFrame
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 Freeze for CanDataFrame
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more