pub struct Alignment(/* private fields */);
Expand description
A newtype struct where its only valid values are powers of 2
Implementations§
source§impl Alignment
impl Alignment
pub const ONE: Alignment = _
pub const TWO: Alignment = _
pub const FOUR: Alignment = _
pub const EIGHT: Alignment = _
pub const SIXTEEN: Alignment = _
pub const MIN_UNIFORM: Alignment = Self::SIXTEEN
pub const fn new(n: u32) -> Option<Alignment>
sourcepub fn from_width(width: u8) -> Alignment
pub fn from_width(width: u8) -> Alignment
Panics
If width
is not a power of 2
sourcepub const fn is_aligned(&self, n: u32) -> bool
pub const fn is_aligned(&self, n: u32) -> bool
Returns whether or not n
is a multiple of this alignment.
Trait Implementations§
source§impl From<VectorSize> for Alignment
impl From<VectorSize> for Alignment
source§fn from(size: VectorSize) -> Alignment
fn from(size: VectorSize) -> Alignment
Converts to this type from the input type.
source§impl Ord for Alignment
impl Ord for Alignment
source§impl PartialEq for Alignment
impl PartialEq for Alignment
source§impl PartialOrd for Alignment
impl PartialOrd for Alignment
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 Copy for Alignment
impl Eq for Alignment
impl StructuralEq for Alignment
impl StructuralPartialEq for Alignment
Auto Trait Implementations§
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<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.