Enum Alignment
pub enum Alignment {
Pointer,
Bytes(NonZero<usize>),
}Expand description
Architecture specific alignment
Variants§
Pointer
This represents 4 byte alignment on 32bit and 8 byte alignment on 64bit architectures
Bytes(NonZero<usize>)
This alignment is architecture independent (derived from integer or float types)
Implementations§
§impl Alignment
impl Alignment
pub fn align_wasm32(&self) -> usize
pub fn align_wasm32(&self) -> usize
for easy migration this gives you the value for wasm32
pub fn align_wasm64(&self) -> usize
pub fn format(&self, ptrsize_expr: &str) -> String
Trait Implementations§
impl Copy for Alignment
impl Eq for Alignment
§impl From<Alignment> for ArchitectureSize
impl From<Alignment> for ArchitectureSize
§fn from(align: Alignment) -> ArchitectureSize
fn from(align: Alignment) -> ArchitectureSize
Converts to this type from the input type.
§impl From<Alignment> for ElementInfo
impl From<Alignment> for ElementInfo
§fn from(align: Alignment) -> ElementInfo
fn from(align: Alignment) -> ElementInfo
Converts to this type from the input type.
§impl Ord for Alignment
impl Ord for Alignment
§fn cmp(&self, other: &Alignment) -> Ordering
fn cmp(&self, other: &Alignment) -> 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 (const: unstable) · 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
§impl PartialOrd for Alignment
impl PartialOrd 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 UnsafeUnpin 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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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