pub struct PowerOfTwo { /* private fields */ }Expand description
A type representing 2^k usize.
Zero is not 2^k though you can create PowerOfTwo by zero. In that case,
zero is considered as usize::MAX + 1 which is another 2^k.
Implementations§
Source§impl PowerOfTwo
impl PowerOfTwo
Sourcepub const fn new(value: usize) -> Option<Self>
pub const fn new(value: usize) -> Option<Self>
Creates a new PowerOfTwo from the given value.
Trait Implementations§
Source§impl Clone for PowerOfTwo
impl Clone for PowerOfTwo
Source§fn clone(&self) -> PowerOfTwo
fn clone(&self) -> PowerOfTwo
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 Debug for PowerOfTwo
impl Debug for PowerOfTwo
Source§impl Hash for PowerOfTwo
impl Hash for PowerOfTwo
Source§impl Ord for PowerOfTwo
impl Ord for PowerOfTwo
Source§impl PartialEq for PowerOfTwo
impl PartialEq for PowerOfTwo
Source§impl PartialOrd for PowerOfTwo
impl PartialOrd for PowerOfTwo
impl Copy for PowerOfTwo
impl Eq for PowerOfTwo
Auto Trait Implementations§
impl Freeze for PowerOfTwo
impl RefUnwindSafe for PowerOfTwo
impl Send for PowerOfTwo
impl Sync for PowerOfTwo
impl Unpin for PowerOfTwo
impl UnwindSafe for PowerOfTwo
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more