Struct const_generic_alignment::AlignedZst
source · pub struct AlignedZst<const ALIGNMENT: usize>where
Alignment<ALIGNMENT>: SupportedAlignment,{ /* private fields */ }Expand description
A Zero-sized type with the specified alignment.
To facilitate deriving traits on types containing this type, this type
implements most relevant traits, including Default, Ord, Copy,
Send, Sync, Unpin, etc.
With the bytemuck optional feature enabled, this type implements the
bytemuck::Pod
trait.
With the freeze optional feature enabled, this type implements the
unstable core::marker::Freeze trait.
Trait Implementations§
source§impl<const ALIGNMENT: usize> Clone for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> Clone for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
source§fn clone(&self) -> AlignedZst<ALIGNMENT>
fn clone(&self) -> AlignedZst<ALIGNMENT>
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<const ALIGNMENT: usize> Debug for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> Debug for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
source§impl<const ALIGNMENT: usize> Default for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> Default for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
source§fn default() -> AlignedZst<ALIGNMENT>
fn default() -> AlignedZst<ALIGNMENT>
Returns the “default value” for a type. Read more
source§impl<const ALIGNMENT: usize> Hash for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> Hash for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
source§impl<const ALIGNMENT: usize> Ord for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> Ord for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
source§fn cmp(&self, other: &AlignedZst<ALIGNMENT>) -> Ordering
fn cmp(&self, other: &AlignedZst<ALIGNMENT>) -> Ordering
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<const ALIGNMENT: usize> PartialEq for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> PartialEq for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
source§fn eq(&self, other: &AlignedZst<ALIGNMENT>) -> bool
fn eq(&self, other: &AlignedZst<ALIGNMENT>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<const ALIGNMENT: usize> PartialOrd for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> PartialOrd for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
source§fn partial_cmp(&self, other: &AlignedZst<ALIGNMENT>) -> Option<Ordering>
fn partial_cmp(&self, other: &AlignedZst<ALIGNMENT>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<const ALIGNMENT: usize> Copy for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> Eq for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> StructuralPartialEq for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
Auto Trait Implementations§
impl<const ALIGNMENT: usize> !Freeze for AlignedZst<ALIGNMENT>
impl<const ALIGNMENT: usize> RefUnwindSafe for AlignedZst<ALIGNMENT>
impl<const ALIGNMENT: usize> Send for AlignedZst<ALIGNMENT>
impl<const ALIGNMENT: usize> Sync for AlignedZst<ALIGNMENT>
impl<const ALIGNMENT: usize> Unpin for AlignedZst<ALIGNMENT>
impl<const ALIGNMENT: usize> UnwindSafe for AlignedZst<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