#[repr(C)]pub struct Aligned<A, T>where
T: ?Sized,{ /* private fields */ }
Expand description
A newtype with alignment of at least A
bytes
Trait Implementations§
Source§impl<A, A2, N, M> AsAlignedChunks<A2, M> for Aligned<A, GenericArray<u8, N>>where
A: Alignment,
A2: Alignment,
A2::Num: IsLessOrEqual<A::Num, Output = B1>,
N: ArrayLength<u8>,
M: ArrayLength<u8> + PartialDiv<A2::Num>,
impl<A, A2, N, M> AsAlignedChunks<A2, M> for Aligned<A, GenericArray<u8, N>>where
A: Alignment,
A2: Alignment,
A2::Num: IsLessOrEqual<A::Num, Output = B1>,
N: ArrayLength<u8>,
M: ArrayLength<u8> + PartialDiv<A2::Num>,
Source§fn as_aligned_chunks(&self) -> &[Aligned<A2, GenericArray<u8, M>>]
fn as_aligned_chunks(&self) -> &[Aligned<A2, GenericArray<u8, M>>]
Break self into aligned chunks of size M.
This is not required to cover all the bytes of Self,
trailing bytes that don’t fit may be left off.
Source§fn as_mut_aligned_chunks(&mut self) -> &mut [Aligned<A2, GenericArray<u8, M>>]
fn as_mut_aligned_chunks(&mut self) -> &mut [Aligned<A2, GenericArray<u8, M>>]
Break self into mutable aligned chunks of size M.
This is not required to cover all the bytes of Self, but must agree with
as_aligned_chunks.
Source§impl<'a, A, A2, T> AsMut<Aligned<A, T>> for &'a mut Aligned<A2, T>where
A: Alignment,
A2: Alignment,
A::Num: IsLessOrEqual<A2::Num, Output = B1>,
impl<'a, A, A2, T> AsMut<Aligned<A, T>> for &'a mut Aligned<A2, T>where
A: Alignment,
A2: Alignment,
A::Num: IsLessOrEqual<A2::Num, Output = B1>,
Source§impl<A, N> AsNeSlice for Aligned<A, GenericArray<u8, N>>
impl<A, N> AsNeSlice for Aligned<A, GenericArray<u8, N>>
Source§fn as_ne_u16_slice(&self) -> &[u16]
fn as_ne_u16_slice(&self) -> &[u16]
Represent the value as native-endian u16’s
Source§fn as_mut_ne_u16_slice(&mut self) -> &mut [u16]
fn as_mut_ne_u16_slice(&mut self) -> &mut [u16]
Represent the value as mutable native-endian u16’s
Source§fn as_ne_u32_slice(&self) -> &[u32]
fn as_ne_u32_slice(&self) -> &[u32]
Represent the value as native-endian u32’s
Source§fn as_mut_ne_u32_slice(&mut self) -> &mut [u32]
fn as_mut_ne_u32_slice(&mut self) -> &mut [u32]
Represent the value as mutable native-endian u32’s
Source§fn as_ne_u64_slice(&self) -> &[u64]
fn as_ne_u64_slice(&self) -> &[u64]
Represent the value as native-endian u64’s
Source§fn as_mut_ne_u64_slice(&mut self) -> &mut [u64]
fn as_mut_ne_u64_slice(&mut self) -> &mut [u64]
Represent the value as mutable native-endian u64’s
Source§impl<'a, A, A2, T> AsRef<Aligned<A, T>> for &'a Aligned<A2, T>where
A: Alignment,
A2: Alignment,
A::Num: IsLessOrEqual<A2::Num, Output = B1>,
impl<'a, A, A2, T> AsRef<Aligned<A, T>> for &'a Aligned<A2, T>where
A: Alignment,
A2: Alignment,
A::Num: IsLessOrEqual<A2::Num, Output = B1>,
Source§impl<A, T, V> FromIterator<V> for Aligned<A, T>where
A: Alignment,
T: FromIterator<V>,
impl<A, T, V> FromIterator<V> for Aligned<A, T>where
A: Alignment,
T: FromIterator<V>,
Source§fn from_iter<U: IntoIterator<Item = V>>(iter: U) -> Self
fn from_iter<U: IntoIterator<Item = V>>(iter: U) -> Self
Creates a value from an iterator. Read more
Source§impl<A, T, N> GenericSequence<T> for Aligned<A, GenericArray<T, N>>where
N: ArrayLength<T>,
A: Alignment,
impl<A, T, N> GenericSequence<T> for Aligned<A, GenericArray<T, N>>where
N: ArrayLength<T>,
A: Alignment,
Implement generic_array::GenericSequence for Aligned sequences
Source§type Sequence = Aligned<A, GenericArray<T, N>>
type Sequence = Aligned<A, GenericArray<T, N>>
Concrete sequence type used in conjuction with reference implementations of
GenericSequence
Source§impl<'a, A, T> IntoIterator for &'a Aligned<A, T>where
A: Alignment,
&'a T: IntoIterator,
impl<'a, A, T> IntoIterator for &'a Aligned<A, T>where
A: Alignment,
&'a T: IntoIterator,
Source§impl<'a, A, T> IntoIterator for &'a mut Aligned<A, T>where
A: Alignment,
&'a mut T: IntoIterator,
impl<'a, A, T> IntoIterator for &'a mut Aligned<A, T>where
A: Alignment,
&'a mut T: IntoIterator,
Source§impl<A, T> IntoIterator for Aligned<A, T>where
A: Alignment,
T: IntoIterator,
impl<A, T> IntoIterator for Aligned<A, T>where
A: Alignment,
T: IntoIterator,
Source§impl<A, T> Ord for Aligned<A, T>where
A: Alignment,
T: Ord,
impl<A, T> Ord for Aligned<A, T>where
A: Alignment,
T: Ord,
Source§impl<A, T> PartialOrd for Aligned<A, T>where
A: Alignment,
T: PartialOrd,
impl<A, T> PartialOrd for Aligned<A, T>where
A: Alignment,
T: PartialOrd,
Source§impl<'a, A, N, K> Split<u8, K> for &'a Aligned<A, GenericArray<u8, N>>where
A: Alignment,
N: ArrayLength<u8> + Sub<K>,
K: ArrayLength<u8> + PartialDiv<A::Num> + 'static,
Diff<N, K>: ArrayLength<u8>,
impl<'a, A, N, K> Split<u8, K> for &'a Aligned<A, GenericArray<u8, N>>where
A: Alignment,
N: ArrayLength<u8> + Sub<K>,
K: ArrayLength<u8> + PartialDiv<A::Num> + 'static,
Diff<N, K>: ArrayLength<u8>,
Implement generic_array::Split api for aligned bytes in a way that preserves aligment info TODO: This could be more generic, but we didn’t need it yet. Instead of u8, a generic value T?
Source§impl<'a, A, N, K> Split<u8, K> for &'a mut Aligned<A, GenericArray<u8, N>>where
A: Alignment,
N: ArrayLength<u8> + Sub<K>,
K: ArrayLength<u8> + PartialDiv<A::Num> + 'static,
Diff<N, K>: ArrayLength<u8>,
impl<'a, A, N, K> Split<u8, K> for &'a mut Aligned<A, GenericArray<u8, N>>where
A: Alignment,
N: ArrayLength<u8> + Sub<K>,
K: ArrayLength<u8> + PartialDiv<A::Num> + 'static,
Diff<N, K>: ArrayLength<u8>,
Implement generic_array::Split API for aligned bytes in a way that preserves aligment info TODO: This could be more generic, but we didn’t need it yet. Instead of u8, a generic value T?
impl<A, T> Eq for Aligned<A, T>where
A: Alignment,
T: Eq,
Auto Trait Implementations§
impl<A, T> Freeze for Aligned<A, T>
impl<A, T> RefUnwindSafe for Aligned<A, T>
impl<A, T> Send for Aligned<A, T>
impl<A, T> Sync for Aligned<A, T>
impl<A, T> Unpin for Aligned<A, T>
impl<A, T> UnwindSafe for Aligned<A, T>
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§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
)