pub struct NumBits {
pub raw: u64,
}
Expand description
Represents a number of bits.
Fields§
§raw: u64
Raw number of bits.
Implementations§
Source§impl NumBits
impl NumBits
Sourcepub const fn to_bytes_floor(self) -> NumBytes
pub const fn to_bytes_floor(self) -> NumBytes
Convert the number of bits to a number of bytes rounding down.
Sourcepub const fn to_bytes_ceil(self) -> NumBytes
pub const fn to_bytes_ceil(self) -> NumBytes
Convert the number of bits to a number of bytes rounding up.
Trait Implementations§
Source§impl AddAssign<NumBytes> for NumBits
impl AddAssign<NumBytes> for NumBits
Source§fn add_assign(&mut self, rhs: NumBytes)
fn add_assign(&mut self, rhs: NumBytes)
Performs the
+=
operation. Read moreSource§impl AddAssign<u64> for NumBits
impl AddAssign<u64> for NumBits
Source§fn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the
+=
operation. Read moreSource§impl AddAssign for NumBits
impl AddAssign for NumBits
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl DivAssign<u64> for NumBits
impl DivAssign<u64> for NumBits
Source§fn div_assign(&mut self, rhs: u64)
fn div_assign(&mut self, rhs: u64)
Performs the
/=
operation. Read moreSource§impl DivAssign for NumBits
impl DivAssign for NumBits
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moreSource§impl MulAssign<u64> for NumBits
impl MulAssign<u64> for NumBits
Source§fn mul_assign(&mut self, rhs: u64)
fn mul_assign(&mut self, rhs: u64)
Performs the
*=
operation. Read moreSource§impl MulAssign for NumBits
impl MulAssign for NumBits
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moreSource§impl Ord for NumBits
impl Ord for NumBits
Source§impl PartialOrd<NumBits> for NumBytes
impl PartialOrd<NumBits> for NumBytes
Source§impl PartialOrd<NumBits> for u64
impl PartialOrd<NumBits> for u64
Source§impl PartialOrd<NumBytes> for NumBits
impl PartialOrd<NumBytes> for NumBits
Source§impl PartialOrd<u64> for NumBits
impl PartialOrd<u64> for NumBits
Source§impl PartialOrd for NumBits
impl PartialOrd for NumBits
Source§impl SubAssign<NumBytes> for NumBits
impl SubAssign<NumBytes> for NumBits
Source§fn sub_assign(&mut self, rhs: NumBytes)
fn sub_assign(&mut self, rhs: NumBytes)
Performs the
-=
operation. Read moreSource§impl SubAssign<u64> for NumBits
impl SubAssign<u64> for NumBits
Source§fn sub_assign(&mut self, rhs: u64)
fn sub_assign(&mut self, rhs: u64)
Performs the
-=
operation. Read moreSource§impl SubAssign for NumBits
impl SubAssign for NumBits
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreimpl Copy for NumBits
impl Eq for NumBits
impl StructuralPartialEq for NumBits
Auto Trait Implementations§
impl Freeze for NumBits
impl RefUnwindSafe for NumBits
impl Send for NumBits
impl Sync for NumBits
impl Unpin for NumBits
impl UnwindSafe for NumBits
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