pub struct ClassicData { /* private fields */ }
Expand description
Payload of a classic CAN data frame.
Contains 0 to 8 Bytes of data.
Implementations§
Source§impl ClassicData
impl ClassicData
Sourcepub fn new(data: &[u8]) -> Result<Self, FrameCreateError>
pub fn new(data: &[u8]) -> Result<Self, FrameCreateError>
Creates a data payload from a raw byte slice.
Returns None
if data
is more than 64 bytes (which is the maximum) or
cannot be represented with an FDCAN DLC.
Sourcepub const fn is_valid_len(len: usize) -> bool
pub const fn is_valid_len(len: usize) -> bool
Checks if the length can be encoded in FDCAN DLC field.
Trait Implementations§
Source§impl Clone for ClassicData
impl Clone for ClassicData
Source§fn clone(&self) -> ClassicData
fn clone(&self) -> ClassicData
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 ClassicData
impl Debug for ClassicData
Source§impl Format for ClassicData
impl Format for ClassicData
impl Copy for ClassicData
Auto Trait Implementations§
impl Freeze for ClassicData
impl RefUnwindSafe for ClassicData
impl Send for ClassicData
impl Sync for ClassicData
impl Unpin for ClassicData
impl UnwindSafe for ClassicData
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
)