#[non_exhaustive]pub struct TypeAlignSpec {
pub aligned_type: AlignedType,
pub abi_alignment: Align,
pub preferred_alignment: Align,
}
Expand description
Represents an alignable type, along with its ABI-mandated and preferred alignments (which may differ).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.aligned_type: AlignedType
The type being aligned.
abi_alignment: Align
The ABI-enforced alignment for the type.
preferred_alignment: Align
The preferred alignment for the type.
NOTE: This must be greater than or equal to the ABI alignment. This invariant is preserved during construction.
Implementations§
Source§impl TypeAlignSpec
impl TypeAlignSpec
Sourcepub const MAX_TYPE_BIT_WIDTH: u32 = 8_388_607u32
pub const MAX_TYPE_BIT_WIDTH: u32 = 8_388_607u32
The maximum type width, in bits, representable in this structure.
Sourcepub fn new(
aligned_type: AlignedType,
abi: Align,
pref: Align,
) -> Result<Self, AlignSpecError>
pub fn new( aligned_type: AlignedType, abi: Align, pref: Align, ) -> Result<Self, AlignSpecError>
Create a new TypeAlignSpec
for the given AlignedType
and alignment
constraints.
Trait Implementations§
Source§impl Clone for TypeAlignSpec
impl Clone for TypeAlignSpec
Source§fn clone(&self) -> TypeAlignSpec
fn clone(&self) -> TypeAlignSpec
Returns a duplicate 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 TypeAlignSpec
impl Debug for TypeAlignSpec
Source§impl FromStr for TypeAlignSpec
impl FromStr for TypeAlignSpec
Source§impl Ord for TypeAlignSpec
impl Ord for TypeAlignSpec
Source§impl PartialEq for TypeAlignSpec
impl PartialEq for TypeAlignSpec
Source§impl PartialOrd for TypeAlignSpec
impl PartialOrd for TypeAlignSpec
impl Copy for TypeAlignSpec
impl Eq for TypeAlignSpec
Auto Trait Implementations§
impl Freeze for TypeAlignSpec
impl RefUnwindSafe for TypeAlignSpec
impl Send for TypeAlignSpec
impl Sync for TypeAlignSpec
impl Unpin for TypeAlignSpec
impl UnwindSafe for TypeAlignSpec
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