pub struct PowerOfTwo(_);
Implementations
sourceimpl PowerOfTwo
impl PowerOfTwo
Represents an integral power-of-two as an exponent
sourcepub fn floor<F: Into<u32>>(f: F) -> PowerOfTwo
pub fn floor<F: Into<u32>>(f: F) -> PowerOfTwo
Converts a number two the nearest PowerOfTwo
less-than-or-equal to it.
sourcepub fn ceiling<F: Into<u32>>(f: F) -> PowerOfTwo
pub fn ceiling<F: Into<u32>>(f: F) -> PowerOfTwo
Converts a number two the nearest PowerOfTwo
greater-than-or-equal to
it.
sourcepub fn zero() -> PowerOfTwo
pub fn zero() -> PowerOfTwo
Creates a new PowerOfTwo
representing the number zero.
Trait Implementations
sourceimpl Clone for PowerOfTwo
impl Clone for PowerOfTwo
sourcefn clone(&self) -> PowerOfTwo
fn clone(&self) -> PowerOfTwo
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PowerOfTwo
impl Debug for PowerOfTwo
sourceimpl Eq for PowerOfTwo
impl Eq for PowerOfTwo
fn assert_receiver_is_total_eq(&self)
sourceimpl Ord for PowerOfTwo
impl Ord for PowerOfTwo
sourceimpl PartialEq<PowerOfTwo> for PowerOfTwo
impl PartialEq<PowerOfTwo> for PowerOfTwo
sourcefn eq(&self, other: &PowerOfTwo) -> bool
fn eq(&self, other: &PowerOfTwo) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &PowerOfTwo) -> bool
fn ne(&self, other: &PowerOfTwo) -> bool
This method tests for !=
.
sourceimpl PartialOrd<PowerOfTwo> for PowerOfTwo
impl PartialOrd<PowerOfTwo> for PowerOfTwo
sourcefn partial_cmp(&self, other: &PowerOfTwo) -> Option<Ordering>
fn partial_cmp(&self, other: &PowerOfTwo) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for PowerOfTwo
impl StructuralEq for PowerOfTwo
impl StructuralPartialEq for PowerOfTwo
Auto Trait Implementations
impl RefUnwindSafe for PowerOfTwo
impl Send for PowerOfTwo
impl Sync for PowerOfTwo
impl Unpin for PowerOfTwo
impl UnwindSafe for PowerOfTwo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more