Struct can_type_rs::j1939::DataField
source · pub struct DataField(/* private fields */);Expand description
Bitfield representing an 8-byte data field.
§Repr u64
| Field | Size (bits) |
|---|---|
| byte 0 | 8 |
| byte 1 | 8 |
| byte 2 | 8 |
| byte 3 | 8 |
| byte 4 | 8 |
| byte 5 | 8 |
| byte 6 | 8 |
| byte 7 | 8 |
Implementations§
source§impl DataField
impl DataField
pub const fn byte_0(&self) -> u8
pub const fn byte_1(&self) -> u8
pub const fn byte_2(&self) -> u8
pub const fn byte_3(&self) -> u8
pub const fn byte_4(&self) -> u8
pub const fn byte_5(&self) -> u8
pub const fn byte_6(&self) -> u8
pub const fn byte_7(&self) -> u8
sourcepub const fn to_le_bytes(&self) -> [u8; 8]
pub const fn to_le_bytes(&self) -> [u8; 8]
Return the 64-bit DataField bitfield as little-endian bytes.
sourcepub const fn to_be_bytes(&self) -> [u8; 8]
pub const fn to_be_bytes(&self) -> [u8; 8]
Return the 64-bit DataField bitfield as big-endian bytes.
sourcepub const fn to_ne_bytes(&self) -> [u8; 8]
pub const fn to_ne_bytes(&self) -> [u8; 8]
Return the 64-bit DataField bitfield as native-endian bytes.
Trait Implementations§
source§impl Conversion for DataField
impl Conversion for DataField
source§fn from_hex(hex_str: &str) -> Self
fn from_hex(hex_str: &str) -> Self
Creates a new DataField bitfield from a base-16 (hex) string slice.
source§fn try_from_bits(bits: u64) -> Option<Self>
fn try_from_bits(bits: u64) -> Option<Self>
Creates a new DataField bitfield from a 64-bit integer.
source§fn try_from_hex(hex_str: &str) -> Option<Self>
fn try_from_hex(hex_str: &str) -> Option<Self>
Creates a new DataField bitfield from a base-16 (hex) string slice.
type Type = u64
source§impl Ord for DataField
impl Ord for DataField
source§impl PartialOrd for DataField
impl PartialOrd for DataField
impl Copy for DataField
impl Eq for DataField
impl StructuralPartialEq for DataField
Auto Trait Implementations§
impl Freeze for DataField
impl RefUnwindSafe for DataField
impl Send for DataField
impl Sync for DataField
impl Unpin for DataField
impl UnwindSafe for DataField
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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)