#[repr(C, align(2))]pub struct Bytes2Alignment2(/* private fields */);
Expand description
Bytes with a size and alignment.
This is used to reduce the monomorphizations for routines that solely rely on the size and alignment of types.
Trait Implementations§
Source§impl AlignedBytes for Bytes2Alignment2
impl AlignedBytes for Bytes2Alignment2
const ALIGNMENT: usize = 2usize
const SIZE: usize = 2usize
type Unaligned = [u8; 2]
fn to_unaligned(&self) -> Self::Unaligned
fn from_unaligned(unaligned: Self::Unaligned) -> Self
Source§fn cast_vec_ref_mut<T: AlignedBytesCast<Self>>(
vec: &mut Vec<T>,
) -> &mut Vec<Self>
fn cast_vec_ref_mut<T: AlignedBytesCast<Self>>( vec: &mut Vec<T>, ) -> &mut Vec<Self>
Source§impl Clone for Bytes2Alignment2
impl Clone for Bytes2Alignment2
Source§fn clone(&self) -> Bytes2Alignment2
fn clone(&self) -> Bytes2Alignment2
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Bytes2Alignment2
impl Debug for Bytes2Alignment2
Source§impl Default for Bytes2Alignment2
impl Default for Bytes2Alignment2
Source§fn default() -> Bytes2Alignment2
fn default() -> Bytes2Alignment2
Returns the “default value” for a type. Read more
Source§impl From<Bytes2Alignment2> for f16
impl From<Bytes2Alignment2> for f16
Source§fn from(value: Bytes2Alignment2) -> Self
fn from(value: Bytes2Alignment2) -> Self
Converts to this type from the input type.
Source§impl From<Bytes2Alignment2> for i16
impl From<Bytes2Alignment2> for i16
Source§fn from(value: Bytes2Alignment2) -> Self
fn from(value: Bytes2Alignment2) -> Self
Converts to this type from the input type.
Source§impl From<Bytes2Alignment2> for u16
impl From<Bytes2Alignment2> for u16
Source§fn from(value: Bytes2Alignment2) -> Self
fn from(value: Bytes2Alignment2) -> Self
Converts to this type from the input type.
Source§impl From<f16> for Bytes2Alignment2
impl From<f16> for Bytes2Alignment2
Source§impl From<i16> for Bytes2Alignment2
impl From<i16> for Bytes2Alignment2
Source§impl From<u16> for Bytes2Alignment2
impl From<u16> for Bytes2Alignment2
Source§impl PartialEq for Bytes2Alignment2
impl PartialEq for Bytes2Alignment2
impl AlignedBytesCast<Bytes2Alignment2> for f16
impl AlignedBytesCast<Bytes2Alignment2> for i16
impl AlignedBytesCast<Bytes2Alignment2> for u16
impl Copy for Bytes2Alignment2
impl Eq for Bytes2Alignment2
impl Pod for Bytes2Alignment2
impl StructuralPartialEq for Bytes2Alignment2
Auto Trait Implementations§
impl Freeze for Bytes2Alignment2
impl RefUnwindSafe for Bytes2Alignment2
impl Send for Bytes2Alignment2
impl Sync for Bytes2Alignment2
impl Unpin for Bytes2Alignment2
impl UnwindSafe for Bytes2Alignment2
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.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
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more