#[repr(transparent)]pub struct RawBytesULE<const N: usize>(pub [u8; N]);Expand description
A u8 array of little-endian data with infallible conversions to and from &u8.
Tuple Fields§
§0: [u8; N]Implementations§
Source§impl<const N: usize> RawBytesULE<N>
impl<const N: usize> RawBytesULE<N>
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
Sourcepub const fn as_unsigned_int(&self) -> u16
pub const fn as_unsigned_int(&self) -> u16
Gets this RawBytesULE as a u16. This is equivalent to calling AsULE::from_unaligned() on u16.
Sourcepub const fn as_signed_int(&self) -> i16
pub const fn as_signed_int(&self) -> i16
Gets this RawBytesULE as a u16. This is equivalent to calling AsULE::from_unaligned() on i16.
Sourcepub const fn from_aligned(value: u16) -> Self
pub const fn from_aligned(value: u16) -> Self
Converts a u16 to a RawBytesULE. This is equivalent to calling AsULE::to_unaligned() on u16.
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_unsigned(v: u16) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_signed(v: i16) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
Sourcepub const fn as_unsigned_int(&self) -> u32
pub const fn as_unsigned_int(&self) -> u32
Gets this RawBytesULE as a u32. This is equivalent to calling AsULE::from_unaligned() on u32.
Sourcepub const fn as_signed_int(&self) -> i32
pub const fn as_signed_int(&self) -> i32
Gets this RawBytesULE as a u32. This is equivalent to calling AsULE::from_unaligned() on i32.
Sourcepub const fn as_float(&self) -> f32
pub const fn as_float(&self) -> f32
Gets this RawBytesULE as a f32. This is equivalent to calling AsULE::from_unaligned() on f32.
Sourcepub const fn from_aligned(value: u32) -> Self
pub const fn from_aligned(value: u32) -> Self
Converts a u32 to a RawBytesULE. This is equivalent to calling AsULE::to_unaligned() on u32.
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_unsigned(v: u32) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_signed(v: i32) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_float(v: f32) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
Sourcepub const fn as_unsigned_int(&self) -> u64
pub const fn as_unsigned_int(&self) -> u64
Gets this RawBytesULE as a u64. This is equivalent to calling AsULE::from_unaligned() on u64.
Sourcepub const fn as_signed_int(&self) -> i64
pub const fn as_signed_int(&self) -> i64
Gets this RawBytesULE as a u64. This is equivalent to calling AsULE::from_unaligned() on i64.
Sourcepub const fn as_float(&self) -> f64
pub const fn as_float(&self) -> f64
Gets this RawBytesULE as a f64. This is equivalent to calling AsULE::from_unaligned() on f64.
Sourcepub const fn from_aligned(value: u64) -> Self
pub const fn from_aligned(value: u64) -> Self
Converts a u64 to a RawBytesULE. This is equivalent to calling AsULE::to_unaligned() on u64.
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_unsigned(v: u64) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_signed(v: i64) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_float(v: f64) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
Sourcepub const fn as_unsigned_int(&self) -> u128
pub const fn as_unsigned_int(&self) -> u128
Gets this RawBytesULE as a u128. This is equivalent to calling AsULE::from_unaligned() on u128.
Sourcepub const fn as_signed_int(&self) -> i128
pub const fn as_signed_int(&self) -> i128
Gets this RawBytesULE as a u128. This is equivalent to calling AsULE::from_unaligned() on i128.
Sourcepub const fn from_aligned(value: u128) -> Self
pub const fn from_aligned(value: u128) -> Self
Converts a u128 to a RawBytesULE. This is equivalent to calling AsULE::to_unaligned() on u128.
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_unsigned(v: u128) -> Self
Source§impl RawBytesULE<{ _ }>
impl RawBytesULE<{ _ }>
pub const fn from_signed(v: i128) -> Self
Trait Implementations§
Source§impl<const N: usize> Clone for RawBytesULE<N>
impl<const N: usize> Clone for RawBytesULE<N>
Source§fn clone(&self) -> RawBytesULE<N>
fn clone(&self) -> RawBytesULE<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<const N: usize> Debug for RawBytesULE<N>
impl<const N: usize> Debug for RawBytesULE<N>
Source§impl From<f32> for RawBytesULE<{ _ }>
impl From<f32> for RawBytesULE<{ _ }>
Source§impl From<f64> for RawBytesULE<{ _ }>
impl From<f64> for RawBytesULE<{ _ }>
Source§impl From<i128> for RawBytesULE<{ _ }>
impl From<i128> for RawBytesULE<{ _ }>
Source§impl From<i16> for RawBytesULE<{ _ }>
impl From<i16> for RawBytesULE<{ _ }>
Source§impl From<i32> for RawBytesULE<{ _ }>
impl From<i32> for RawBytesULE<{ _ }>
Source§impl From<i64> for RawBytesULE<{ _ }>
impl From<i64> for RawBytesULE<{ _ }>
Source§impl From<u128> for RawBytesULE<{ _ }>
impl From<u128> for RawBytesULE<{ _ }>
Source§impl From<u16> for RawBytesULE<{ _ }>
impl From<u16> for RawBytesULE<{ _ }>
Source§impl From<u32> for RawBytesULE<{ _ }>
impl From<u32> for RawBytesULE<{ _ }>
Source§impl From<u64> for RawBytesULE<{ _ }>
impl From<u64> for RawBytesULE<{ _ }>
Source§impl<const N: usize> Hash for RawBytesULE<N>
impl<const N: usize> Hash for RawBytesULE<N>
Source§impl<const N: usize> Ord for RawBytesULE<N>
impl<const N: usize> Ord for RawBytesULE<N>
Source§fn cmp(&self, other: &RawBytesULE<N>) -> Ordering
fn cmp(&self, other: &RawBytesULE<N>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<const N: usize> PartialEq for RawBytesULE<N>
impl<const N: usize> PartialEq for RawBytesULE<N>
Source§impl<const N: usize> PartialOrd for RawBytesULE<N>
impl<const N: usize> PartialOrd for RawBytesULE<N>
Source§impl<const N: usize> ULE for RawBytesULE<N>
impl<const N: usize> ULE for RawBytesULE<N>
Source§fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
fn validate_bytes(bytes: &[u8]) -> Result<(), UleError>
&[u8]. Read moreSource§unsafe fn slice_from_bytes_unchecked(bytes: &[u8]) -> &[Self]
unsafe fn slice_from_bytes_unchecked(bytes: &[u8]) -> &[Self]
&[u8], and return it as &[Self] with the same lifetime, assuming
that this byte slice has previously been run through Self::parse_bytes_to_slice() with
success. Read more