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.
Implementations§
Source§impl<const ALIGNMENT: usize> AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
impl<const ALIGNMENT: usize> AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
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 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<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§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§impl<const ALIGNMENT: usize> Zeroable for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
Available on crate feature bytemuck
only.
impl<const ALIGNMENT: usize> Zeroable for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
Available on crate feature
bytemuck
only.impl<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> Pod for AlignedZst<ALIGNMENT>where
Alignment<ALIGNMENT>: SupportedAlignment,
Available on crate feature
bytemuck
only.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
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
.