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: Self = _
pub const TWO: Self = _
pub const FOUR: Self = _
pub const EIGHT: Self = _
pub const SIXTEEN: Self = _
pub const MIN_UNIFORM: Self = Self::SIXTEEN
pub const fn new(n: u32) -> Option<Self>
Sourcepub fn from_width(width: u8) -> Self
pub fn from_width(width: u8) -> Self
§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) -> Self
fn from(size: VectorSize) -> Self
Converts to this type from the input type.
Source§impl Ord for Alignment
impl Ord for Alignment
Source§impl PartialOrd for Alignment
impl PartialOrd for Alignment
impl Copy for Alignment
impl Eq 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 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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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.