pub enum Alignment {
Pointer,
Bytes(NonZeroUsize),
}
Expand description
Architecture specific alignment
Variants§
Pointer
This represents 4 byte alignment on 32bit and 8 byte alignment on 64bit architectures
Bytes(NonZeroUsize)
This alignment is architecture independent (derived from integer or float types)
Implementations§
Trait Implementations§
source§impl From<Alignment> for ArchitectureSize
impl From<Alignment> for ArchitectureSize
source§impl From<Alignment> for ElementInfo
impl From<Alignment> for ElementInfo
source§impl Ord for Alignment
impl Ord for Alignment
source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Needed for determining the max alignment of an object from its parts. The ordering is: Bytes(1) < Bytes(2) < Bytes(4) < Pointer < Bytes(8) as a Pointer is either four or eight byte aligned, depending on the architecture
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialOrd for Alignment
impl PartialOrd for Alignment
impl Copy for Alignment
impl Eq for Alignment
impl StructuralPartialEq for Alignment
Auto Trait Implementations§
impl Freeze for Alignment
impl RefUnwindSafe for Alignment
impl Send for Alignment
impl Sync for Alignment
impl Unpin for Alignment
impl UnwindSafe for 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
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.