#[repr(C)]pub struct EndianPrimitive<B, T: EndianConvert, Alignment = ()> { /* private fields */ }
Expand description
A POD container for a primitive that stores a value in the specified endianness
in memory, and transforms on get
/set
Implementations§
Source§impl<B: ByteOrder, T: EndianConvert, A> EndianPrimitive<B, T, A>
impl<B: ByteOrder, T: EndianConvert, A> EndianPrimitive<B, T, A>
Trait Implementations§
Source§impl<B, T: EndianConvert, A> Clone for EndianPrimitive<B, T, A>
impl<B, T: EndianConvert, A> Clone for EndianPrimitive<B, T, A>
Source§impl<B: ByteOrder, T: Debug + EndianConvert, A> Debug for EndianPrimitive<B, T, A>
impl<B: ByteOrder, T: Debug + EndianConvert, A> Debug for EndianPrimitive<B, T, A>
Source§impl<B: ByteOrder, T: Default + EndianConvert, A> Default for EndianPrimitive<B, T, A>
impl<B: ByteOrder, T: Default + EndianConvert, A> Default for EndianPrimitive<B, T, A>
Source§impl<B: ByteOrder, T: EndianConvert, A> From<T> for EndianPrimitive<B, T, A>
impl<B: ByteOrder, T: EndianConvert, A> From<T> for EndianPrimitive<B, T, A>
Source§impl<B, T: EndianConvert + Hash, A> Hash for EndianPrimitive<B, T, A>
impl<B, T: EndianConvert + Hash, A> Hash for EndianPrimitive<B, T, A>
Source§impl<B: ByteOrder, T: EndianConvert + Ord, A> Ord for EndianPrimitive<B, T, A>
impl<B: ByteOrder, T: EndianConvert + Ord, A> Ord for EndianPrimitive<B, T, A>
Source§impl<ARHS, A, BRHS: ByteOrder, RHS: EndianConvert, B: ByteOrder, T: EndianConvert + PartialEq<RHS>> PartialEq<EndianPrimitive<BRHS, RHS, ARHS>> for EndianPrimitive<B, T, A>
impl<ARHS, A, BRHS: ByteOrder, RHS: EndianConvert, B: ByteOrder, T: EndianConvert + PartialEq<RHS>> PartialEq<EndianPrimitive<BRHS, RHS, ARHS>> for EndianPrimitive<B, T, A>
Source§fn eq(&self, other: &EndianPrimitive<BRHS, RHS, ARHS>) -> bool
fn eq(&self, other: &EndianPrimitive<BRHS, RHS, ARHS>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<ARHS, A, BRHS: ByteOrder, RHS: EndianConvert, B: ByteOrder, T: EndianConvert + PartialOrd<RHS>> PartialOrd<EndianPrimitive<BRHS, RHS, ARHS>> for EndianPrimitive<B, T, A>
impl<ARHS, A, BRHS: ByteOrder, RHS: EndianConvert, B: ByteOrder, T: EndianConvert + PartialOrd<RHS>> PartialOrd<EndianPrimitive<BRHS, RHS, ARHS>> for EndianPrimitive<B, T, A>
Source§impl<B: Pod, T: EndianConvert, A> Pod for EndianPrimitive<B, T, A>
impl<B: Pod, T: EndianConvert, A> Pod for EndianPrimitive<B, T, A>
Source§unsafe fn uninitialized() -> Self
unsafe fn uninitialized() -> Self
Generates a new uninitialized instance of a POD type.
Source§fn map<T>(&self) -> Option<&T>where
T: Pod,
fn map<T>(&self) -> Option<&T>where
T: Pod,
Converts a POD reference from one to another type of the same size. Read more
Source§fn map_mut<T>(&mut self) -> Option<&mut T>where
T: Pod,
fn map_mut<T>(&mut self) -> Option<&mut T>where
T: Pod,
Converts a mutable POD reference from one to another type of the same size. Read more
Source§fn map_copy<T>(&self) -> Option<T>where
T: Pod,
fn map_copy<T>(&self) -> Option<T>where
T: Pod,
Converts a POD type from one to another of the same size. Read more
Source§fn try_map<T>(&self) -> Option<&T>where
T: Pod,
fn try_map<T>(&self) -> Option<&T>where
T: Pod,
Converts a POD reference from one to another type of the same or lesser size. Read more
Source§fn try_map_mut<T>(&mut self) -> Option<&mut T>where
T: Pod,
fn try_map_mut<T>(&mut self) -> Option<&mut T>where
T: Pod,
Converts a mutable POD reference from one to another type of the same or lesser size. Read more
Source§fn try_map_copy<T>(&self) -> Option<T>where
T: Pod,
fn try_map_copy<T>(&self) -> Option<T>where
T: Pod,
Converts a POD type from one to another of the same or lesser size. Read more
Source§fn map_box<T>(self: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Pod,
fn map_box<T>(self: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Pod,
Converts a boxed POD type from one to another of the same size. Read more
Source§fn split<T>(&self) -> Option<&[T]>where
T: Pod,
fn split<T>(&self) -> Option<&[T]>where
T: Pod,
Converts a POD reference into a slice of another type. Read more
Source§fn split_mut<T>(&mut self) -> Option<&mut [T]>where
T: Pod,
fn split_mut<T>(&mut self) -> Option<&mut [T]>where
T: Pod,
Converts a mutable POD reference into a slice of another type. Read more
Source§fn try_split<T>(&self) -> &[T]where
T: Pod,
fn try_split<T>(&self) -> &[T]where
T: Pod,
Converts a POD reference into a slice of another type. Read more
Source§fn try_split_mut<T>(&mut self) -> &mut [T]where
T: Pod,
fn try_split_mut<T>(&mut self) -> &mut [T]where
T: Pod,
Converts a mutable POD reference into a slice of another type. Read more
Source§fn split_box<T>(self: Box<Self>) -> Result<Box<[T]>, Box<Self>>where
T: Pod,
fn split_box<T>(self: Box<Self>) -> Result<Box<[T]>, Box<Self>>where
T: Pod,
Converts a boxed POD object into a boxed slice of another type. Read more
Source§fn split_vec<T>(self: Box<Self>) -> Result<Vec<T>, Box<Self>>where
T: Pod,
fn split_vec<T>(self: Box<Self>) -> Result<Vec<T>, Box<Self>>where
T: Pod,
Converts a boxed POD object into a vector of another type. Read more
Source§fn map_slice<T>(s: &[Self]) -> Option<&[T]>where
T: Pod,
fn map_slice<T>(s: &[Self]) -> Option<&[T]>where
T: Pod,
Maps a POD slice from one type to another. Read more
Source§fn map_slice_mut<T>(s: &mut [Self]) -> Option<&mut [T]>where
T: Pod,
fn map_slice_mut<T>(s: &mut [Self]) -> Option<&mut [T]>where
T: Pod,
Maps a mutable POD slice from one type to another. Read more
Source§fn try_map_slice<T>(s: &[Self]) -> &[T]where
T: Pod,
fn try_map_slice<T>(s: &[Self]) -> &[T]where
T: Pod,
Maps a POD slice from one type to another. Read more
Source§fn try_map_slice_mut<T>(s: &mut [Self]) -> &mut [T]where
T: Pod,
fn try_map_slice_mut<T>(s: &mut [Self]) -> &mut [T]where
T: Pod,
Maps a mutable POD slice from one type to another. Read more
Source§fn map_slice_box<T>(s: Box<[Self]>) -> Result<Box<[T]>, Box<[Self]>>where
T: Pod,
fn map_slice_box<T>(s: Box<[Self]>) -> Result<Box<[T]>, Box<[Self]>>where
T: Pod,
Maps a boxed POD slice from one type to another. Read more
Source§fn map_slice_vec<T>(s: Vec<Self>) -> Result<Vec<T>, Vec<Self>>where
T: Pod,
fn map_slice_vec<T>(s: Vec<Self>) -> Result<Vec<T>, Vec<Self>>where
T: Pod,
Maps a POD vector from one type to another. Read more
Source§fn merge<T>(s: &[Self]) -> Option<&T>where
T: Pod,
fn merge<T>(s: &[Self]) -> Option<&T>where
T: Pod,
Converts a POD slice into another type. Read more
Source§fn merge_mut<T>(s: &mut [Self]) -> Option<&mut T>where
T: Pod,
fn merge_mut<T>(s: &mut [Self]) -> Option<&mut T>where
T: Pod,
Converts a mutable POD slice into another type. Read more
Source§fn merge_copy<T>(s: &[Self]) -> Option<T>where
T: Pod,
fn merge_copy<T>(s: &[Self]) -> Option<T>where
T: Pod,
Converts a POD slice into another type. Read more
Source§fn try_merge<T>(s: &[Self]) -> Option<&T>where
T: Pod,
fn try_merge<T>(s: &[Self]) -> Option<&T>where
T: Pod,
Converts a POD slice into another type. Read more
Source§fn try_merge_mut<T>(s: &mut [Self]) -> Option<&mut T>where
T: Pod,
fn try_merge_mut<T>(s: &mut [Self]) -> Option<&mut T>where
T: Pod,
Converts a mutable POD slice into another type. Read more
Source§fn try_merge_copy<T>(s: &[Self]) -> Option<T>where
T: Pod,
fn try_merge_copy<T>(s: &[Self]) -> Option<T>where
T: Pod,
Converts a POD slice into another type. Read more
Source§fn merge_box<T>(s: Box<[Self]>) -> Result<Box<T>, Box<[Self]>>where
T: Pod,
fn merge_box<T>(s: Box<[Self]>) -> Result<Box<T>, Box<[Self]>>where
T: Pod,
Converts a boxed POD slice into another boxed type. Read more
Source§fn merge_vec<T>(s: Vec<Self>) -> Result<Box<T>, Vec<Self>>where
T: Pod,
fn merge_vec<T>(s: Vec<Self>) -> Result<Box<T>, Vec<Self>>where
T: Pod,
Converts a POD vector into another boxed type. Read more
Source§unsafe fn from_ptr<T>(source: *const T) -> Self
unsafe fn from_ptr<T>(source: *const T) -> Self
Creates a new POD instance from an unaligned pointer. Read more
Source§fn from_ref<T>(p: &T) -> Option<Self>where
T: Pod,
fn from_ref<T>(p: &T) -> Option<Self>where
T: Pod,
Creates a new POD instance with the inverse of
map_copy()
Source§fn from_slice<T>(p: &[T]) -> Option<Self>where
T: Pod,
fn from_slice<T>(p: &[T]) -> Option<Self>where
T: Pod,
Creates a new POD instance with the inverse of
merge_copy()
Source§fn from_boxed_slice<T>(p: Box<[T]>) -> Result<Box<Self>, Box<[T]>>where
T: Pod,
fn from_boxed_slice<T>(p: Box<[T]>) -> Result<Box<Self>, Box<[T]>>where
T: Pod,
Creates a new POD instance with the inverse of
merge_box()
Source§fn from_vec<T>(p: Vec<T>) -> Result<Box<Self>, Vec<T>>where
T: Pod,
fn from_vec<T>(p: Vec<T>) -> Result<Box<Self>, Vec<T>>where
T: Pod,
Creates a new POD instance with the inverse of
merge_vec()
Source§fn slice_from_boxed_slice<T>(p: Box<[T]>) -> Result<Box<[Self]>, Box<[T]>>where
T: Pod,
fn slice_from_boxed_slice<T>(p: Box<[T]>) -> Result<Box<[Self]>, Box<[T]>>where
T: Pod,
Creates a new POD instance with the inverse of
map_slice_box()
Source§fn ref_from<T>(p: &T) -> Option<&Self>where
T: Pod,
fn ref_from<T>(p: &T) -> Option<&Self>where
T: Pod,
Creates a POD reference with the inverse of
map()
Source§fn ref_from_mut<T>(p: &mut T) -> Option<&mut Self>where
T: Pod,
fn ref_from_mut<T>(p: &mut T) -> Option<&mut Self>where
T: Pod,
Creates a mutable POD reference with the inverse of
map_mut()
Source§fn ref_from_slice<T>(p: &[T]) -> Option<&Self>where
T: Pod,
fn ref_from_slice<T>(p: &[T]) -> Option<&Self>where
T: Pod,
Creates a POD reference with the inverse of
merge()
Source§fn ref_from_slice_mut<T>(p: &mut [T]) -> Option<&mut Self>where
T: Pod,
fn ref_from_slice_mut<T>(p: &mut [T]) -> Option<&mut Self>where
T: Pod,
Creates a mutable POD reference with the inverse of
merge_mut()
Source§fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Borrows the POD as a mutable byte slice
Source§fn from_bytes(p: &[u8]) -> Option<Self>
fn from_bytes(p: &[u8]) -> Option<Self>
Safely creates a POD value from a potentially unaligned slice Read more
Source§fn ref_from_bytes(p: &[u8]) -> Option<&Self>
fn ref_from_bytes(p: &[u8]) -> Option<&Self>
Borrows a new instance of the POD from a byte slice Read more
Source§fn ref_from_bytes_mut(p: &mut [u8]) -> Option<&mut Self>
fn ref_from_bytes_mut(p: &mut [u8]) -> Option<&mut Self>
Borrows a mutable instance of the POD from a mutable byte slice Read more
Source§fn from_byte_slice(p: Box<[u8]>) -> Result<Box<Self>, Box<[u8]>>
fn from_byte_slice(p: Box<[u8]>) -> Result<Box<Self>, Box<[u8]>>
Converts a boxed slice to a boxed instance of the POD type Read more
impl<B, T: EndianConvert, A: Copy> Copy for EndianPrimitive<B, T, A>
impl<A, B: ByteOrder, T: EndianConvert + Eq> Eq for EndianPrimitive<B, T, A>
impl<B, T: EndianConvert, A: Unaligned> Packed for EndianPrimitive<B, T, A>
impl<B, T: EndianConvert, A: Unaligned> Unaligned for EndianPrimitive<B, T, A>
Auto Trait Implementations§
impl<B, T, Alignment> Freeze for EndianPrimitive<B, T, Alignment>
impl<B, T, Alignment> RefUnwindSafe for EndianPrimitive<B, T, Alignment>
impl<B, T, Alignment = ()> !Send for EndianPrimitive<B, T, Alignment>
impl<B, T, Alignment = ()> !Sync for EndianPrimitive<B, T, Alignment>
impl<B, T, Alignment> Unpin for EndianPrimitive<B, T, Alignment>
impl<B, T, Alignment> UnwindSafe for EndianPrimitive<B, T, Alignment>
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