pub struct NBits<const N: usize>(pub [u8; N]);Expand description
NBits is a wrapper around an array of bytes that provides
arithmetic and bitwise operations on the bits represented
by the bytes. The operations are performed in big-endian
order.
Tuple Fields§
§0: [u8; N]Implementations§
Trait Implementations§
Source§impl<const N: usize> AddAssign<&NBits<N>> for NBits<N>
impl<const N: usize> AddAssign<&NBits<N>> for NBits<N>
Source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the
+= operation. Read moreSource§impl<const N: usize, U: Into<u64>> AddAssign<U> for NBits<N>
impl<const N: usize, U: Into<u64>> AddAssign<U> for NBits<N>
Source§fn add_assign(&mut self, other: U)
fn add_assign(&mut self, other: U)
Performs the
+= operation. Read moreSource§impl<const N: usize> BitAndAssign<&NBits<N>> for NBits<N>
impl<const N: usize> BitAndAssign<&NBits<N>> for NBits<N>
Source§fn bitand_assign(&mut self, other: &Self)
fn bitand_assign(&mut self, other: &Self)
Performs the
&= operation. Read moreSource§impl<const N: usize> BitOrAssign<&NBits<N>> for NBits<N>
impl<const N: usize> BitOrAssign<&NBits<N>> for NBits<N>
Source§fn bitor_assign(&mut self, other: &Self)
fn bitor_assign(&mut self, other: &Self)
Performs the
|= operation. Read moreSource§impl<const N: usize> BitXorAssign<&NBits<N>> for NBits<N>
impl<const N: usize> BitXorAssign<&NBits<N>> for NBits<N>
Source§fn bitxor_assign(&mut self, other: &Self)
fn bitxor_assign(&mut self, other: &Self)
Performs the
^= operation. Read moreSource§impl<const N: usize> DivAssign<&NBits<N>> for NBits<N>
impl<const N: usize> DivAssign<&NBits<N>> for NBits<N>
Source§fn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
Performs the
/= operation. Read moreSource§impl<const N: usize, U: Into<u64>> DivAssign<U> for NBits<N>
impl<const N: usize, U: Into<u64>> DivAssign<U> for NBits<N>
Source§fn div_assign(&mut self, other: U)
fn div_assign(&mut self, other: U)
Performs the
/= operation. Read moreSource§impl<const N: usize> MulAssign<&NBits<N>> for NBits<N>
impl<const N: usize> MulAssign<&NBits<N>> for NBits<N>
Source§fn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
Performs the
*= operation. Read moreSource§impl<const N: usize, U: Into<u64>> MulAssign<U> for NBits<N>
impl<const N: usize, U: Into<u64>> MulAssign<U> for NBits<N>
Source§fn mul_assign(&mut self, other: U)
fn mul_assign(&mut self, other: U)
Performs the
*= operation. Read moreSource§impl<const N: usize> Ord for NBits<N>
impl<const N: usize> Ord for NBits<N>
Source§impl<const N: usize> PartialOrd for NBits<N>
impl<const N: usize> PartialOrd for NBits<N>
Source§impl<const N: usize> RemAssign<&NBits<N>> for NBits<N>
impl<const N: usize> RemAssign<&NBits<N>> for NBits<N>
Source§fn rem_assign(&mut self, other: &Self)
fn rem_assign(&mut self, other: &Self)
Performs the
%= operation. Read moreSource§impl<const N: usize, U: Into<u64>> RemAssign<U> for NBits<N>
impl<const N: usize, U: Into<u64>> RemAssign<U> for NBits<N>
Source§fn rem_assign(&mut self, other: U)
fn rem_assign(&mut self, other: U)
Performs the
%= operation. Read moreSource§impl<const N: usize> ShlAssign<usize> for NBits<N>
impl<const N: usize> ShlAssign<usize> for NBits<N>
Source§fn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the
<<= operation. Read moreSource§impl<const N: usize> ShrAssign<usize> for NBits<N>
impl<const N: usize> ShrAssign<usize> for NBits<N>
Source§fn shr_assign(&mut self, rhs: usize)
fn shr_assign(&mut self, rhs: usize)
Performs the
>>= operation. Read moreSource§impl<const N: usize> SubAssign<&NBits<N>> for NBits<N>
impl<const N: usize> SubAssign<&NBits<N>> for NBits<N>
Source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the
-= operation. Read moreSource§impl<const N: usize, U: Into<u64>> SubAssign<U> for NBits<N>
impl<const N: usize, U: Into<u64>> SubAssign<U> for NBits<N>
Source§fn sub_assign(&mut self, other: U)
fn sub_assign(&mut self, other: U)
Performs the
-= operation. Read moreimpl<const N: usize> Eq for NBits<N>
impl<const N: usize> StructuralPartialEq for NBits<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for NBits<N>
impl<const N: usize> RefUnwindSafe for NBits<N>
impl<const N: usize> Send for NBits<N>
impl<const N: usize> Sync for NBits<N>
impl<const N: usize> Unpin for NBits<N>
impl<const N: usize> UnwindSafe for NBits<N>
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