#[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<2>
impl RawBytesULE<2>
Sourcepub fn as_unsigned_int(&self) -> u16
pub fn as_unsigned_int(&self) -> u16
Gets this RawBytesULE
as a u16
. This is equivalent to calling AsULE::from_unaligned()
on the appropriately sized type.
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 the appropriately sized type.
Source§impl RawBytesULE<4>
impl RawBytesULE<4>
Sourcepub fn as_unsigned_int(&self) -> u32
pub fn as_unsigned_int(&self) -> u32
Gets this RawBytesULE
as a u32
. This is equivalent to calling AsULE::from_unaligned()
on the appropriately sized type.
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 the appropriately sized type.
Source§impl RawBytesULE<8>
impl RawBytesULE<8>
Sourcepub fn as_unsigned_int(&self) -> u64
pub fn as_unsigned_int(&self) -> u64
Gets this RawBytesULE
as a u64
. This is equivalent to calling AsULE::from_unaligned()
on the appropriately sized type.
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 the appropriately sized type.
Source§impl RawBytesULE<16>
impl RawBytesULE<16>
Sourcepub fn as_unsigned_int(&self) -> u128
pub fn as_unsigned_int(&self) -> u128
Gets this RawBytesULE
as a u128
. This is equivalent to calling AsULE::from_unaligned()
on the appropriately sized type.
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 the appropriately sized type.
Source§impl RawBytesULE<2>
impl RawBytesULE<2>
pub const fn from_unsigned(v: u16) -> Self
Source§impl RawBytesULE<4>
impl RawBytesULE<4>
pub const fn from_unsigned(v: u32) -> Self
Source§impl RawBytesULE<8>
impl RawBytesULE<8>
pub const fn from_unsigned(v: u64) -> Self
Source§impl RawBytesULE<16>
impl RawBytesULE<16>
pub const fn from_unsigned(v: u128) -> Self
Source§impl RawBytesULE<2>
impl RawBytesULE<2>
pub const fn from_signed(v: i16) -> Self
Source§impl RawBytesULE<4>
impl RawBytesULE<4>
pub const fn from_signed(v: i32) -> Self
Source§impl RawBytesULE<8>
impl RawBytesULE<8>
pub const fn from_signed(v: i64) -> Self
Source§impl RawBytesULE<16>
impl RawBytesULE<16>
pub const fn from_signed(v: i128) -> Self
Source§impl RawBytesULE<3>
impl RawBytesULE<3>
Sourcepub const fn from_unvalidated_char(uc: UnvalidatedChar) -> Self
pub const fn from_unvalidated_char(uc: UnvalidatedChar) -> Self
Converts a UnvalidatedChar
to its ULE type. This is equivalent to calling
AsULE::to_unaligned
.
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<i128> for RawBytesULE<16>
impl From<i128> for RawBytesULE<16>
Source§impl From<i16> for RawBytesULE<2>
impl From<i16> for RawBytesULE<2>
Source§impl From<i32> for RawBytesULE<4>
impl From<i32> for RawBytesULE<4>
Source§impl From<i64> for RawBytesULE<8>
impl From<i64> for RawBytesULE<8>
Source§impl From<u128> for RawBytesULE<16>
impl From<u128> for RawBytesULE<16>
Source§impl From<u16> for RawBytesULE<2>
impl From<u16> for RawBytesULE<2>
Source§impl From<u32> for RawBytesULE<4>
impl From<u32> for RawBytesULE<4>
Source§impl From<u64> for RawBytesULE<8>
impl From<u64> for RawBytesULE<8>
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_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
fn validate_byte_slice(bytes: &[u8]) -> Result<(), ZeroVecError>
&[u8]
. Read moreSource§fn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
fn parse_byte_slice(bytes: &[u8]) -> Result<&[Self], ZeroVecError>
Source§unsafe fn from_byte_slice_unchecked(bytes: &[u8]) -> &[Self]
unsafe fn from_byte_slice_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_byte_slice()
with
success. Read more