pub struct PowerOfTwo64 { /* private fields */ }Expand description
Represents a power of two, as a 64-bit value, which includes zero.
Implementations§
Source§impl PowerOfTwo64
impl PowerOfTwo64
Sourcepub const ZERO: Self
pub const ZERO: Self
Represents PowerOfTwo64 zero.
Sourcepub const unsafe fn new_unchecked(value: u64) -> Self
pub const unsafe fn new_unchecked(value: u64) -> Self
Creates a new PowerOfTwo64 from a 64-bit value.
§Safety
This function does not validate value. It is up to the
caller to ensure that its value is a power of two.
Sourcepub const fn new(value: u64) -> Result<Self, PowerOfTwoError>
pub const fn new(value: u64) -> Result<Self, PowerOfTwoError>
Creates a new PowerOfTwo64 from a 64-bit value.
§Errors
Returns PowerOfTwoError::NotAPowerOfTwo if value is not a power of two.
Sourcepub const fn value(self) -> u64
pub const fn value(self) -> u64
Returns the underlying value of the PowerOfTwo64.
Trait Implementations§
Source§impl Clone for PowerOfTwo64
impl Clone for PowerOfTwo64
Source§fn clone(&self) -> PowerOfTwo64
fn clone(&self) -> PowerOfTwo64
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 PowerOfTwo64
impl Debug for PowerOfTwo64
Source§impl Display for PowerOfTwo64
impl Display for PowerOfTwo64
Source§impl Hash for PowerOfTwo64
impl Hash for PowerOfTwo64
Source§impl PartialEq for PowerOfTwo64
impl PartialEq for PowerOfTwo64
Source§impl ReprC for PowerOfTwo64
impl ReprC for PowerOfTwo64
impl Copy for PowerOfTwo64
impl Eq for PowerOfTwo64
impl StructuralPartialEq for PowerOfTwo64
Auto Trait Implementations§
impl Freeze for PowerOfTwo64
impl RefUnwindSafe for PowerOfTwo64
impl Send for PowerOfTwo64
impl Sync for PowerOfTwo64
impl Unpin for PowerOfTwo64
impl UnsafeUnpin for PowerOfTwo64
impl UnwindSafe for PowerOfTwo64
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