Struct zerovec::ule::RawBytesULE
source · #[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 moresource§fn as_byte_slice(slice: &[Self]) -> &[u8]
fn as_byte_slice(slice: &[Self]) -> &[u8]
impl<const N: usize> Copy for RawBytesULE<N>
impl<const N: usize> Eq for RawBytesULE<N>
impl<const N: usize> StructuralPartialEq for RawBytesULE<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for RawBytesULE<N>
impl<const N: usize> RefUnwindSafe for RawBytesULE<N>
impl<const N: usize> Send for RawBytesULE<N>
impl<const N: usize> Sync for RawBytesULE<N>
impl<const N: usize> Unpin for RawBytesULE<N>
impl<const N: usize> UnwindSafe for RawBytesULE<N>
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
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)
clone_to_uninit
)