Expand description
Bit vector
This is a newtype wrapper around Uint<BITS, LIMBS> that restricts
operations to those relevant for bit vectors.
Implementations
sourceimpl<const BITS: usize, const LIMBS: usize> Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> Bits<BITS, LIMBS>
sourcepub fn reverse_bits(self) -> Self
pub fn reverse_bits(self) -> Self
See Uint::reverse_bits for documentation.
sourcepub fn as_le_bytes(&self) -> Cow<'_, [u8]>
pub fn as_le_bytes(&self) -> Cow<'_, [u8]>
See Uint::as_le_bytes for documentation.
sourcepub fn leading_zeros(&self) -> usize
pub fn leading_zeros(&self) -> usize
See Uint::leading_zeros for documentation.
sourcepub fn leading_ones(&self) -> usize
pub fn leading_ones(&self) -> usize
See Uint::leading_ones for documentation.
sourcepub fn trailing_zeros(&self) -> usize
pub fn trailing_zeros(&self) -> usize
See Uint::trailing_zeros for documentation.
sourcepub fn trailing_ones(&self) -> usize
pub fn trailing_ones(&self) -> usize
See Uint::trailing_ones for documentation.
sourcepub fn as_limbs_mut(&mut self) -> &mut [u64; LIMBS]
pub fn as_limbs_mut(&mut self) -> &mut [u64; LIMBS]
See Uint::as_limbs_mut for documentation.
sourcepub fn checked_shl(self, a: usize) -> Option<Self>
pub fn checked_shl(self, a: usize) -> Option<Self>
See Uint::checked_shl for documentation.
sourcepub fn checked_shr(self, a: usize) -> Option<Self>
pub fn checked_shr(self, a: usize) -> Option<Self>
See Uint::checked_shr for documentation.
sourcepub fn overflowing_shl(self, a: usize) -> (Self, bool)
pub fn overflowing_shl(self, a: usize) -> (Self, bool)
See Uint::overflowing_shl for documentation.
sourcepub fn overflowing_shr(self, a: usize) -> (Self, bool)
pub fn overflowing_shr(self, a: usize) -> (Self, bool)
See Uint::overflowing_shr for documentation.
sourcepub fn wrapping_shl(self, a: usize) -> Self
pub fn wrapping_shl(self, a: usize) -> Self
See Uint::wrapping_shl for documentation.
sourcepub fn wrapping_shr(self, a: usize) -> Self
pub fn wrapping_shr(self, a: usize) -> Self
See Uint::wrapping_shr for documentation.
sourcepub fn rotate_left(self, a: usize) -> Self
pub fn rotate_left(self, a: usize) -> Self
See Uint::rotate_left for documentation.
sourcepub fn rotate_right(self, a: usize) -> Self
pub fn rotate_right(self, a: usize) -> Self
See Uint::rotate_right for documentation.
Trait Implementations
sourceimpl<const BITS: usize, const LIMBS: usize> BitAnd<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitAnd<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourceimpl<const BITS: usize, const LIMBS: usize> BitAnd<&'_ Bits<BITS, LIMBS>> for &Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitAnd<&'_ Bits<BITS, LIMBS>> for &Bits<BITS, LIMBS>
sourceimpl<const BITS: usize, const LIMBS: usize> BitAndAssign<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitAndAssign<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourcefn bitand_assign(&mut self, rhs: &Bits<BITS, LIMBS>)
fn bitand_assign(&mut self, rhs: &Bits<BITS, LIMBS>)
Performs the &= operation. Read more
sourceimpl<const BITS: usize, const LIMBS: usize> BitAndAssign<Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitAndAssign<Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourcefn bitand_assign(&mut self, rhs: Bits<BITS, LIMBS>)
fn bitand_assign(&mut self, rhs: Bits<BITS, LIMBS>)
Performs the &= operation. Read more
sourceimpl<const BITS: usize, const LIMBS: usize> BitOr<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitOr<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourceimpl<const BITS: usize, const LIMBS: usize> BitOr<&'_ Bits<BITS, LIMBS>> for &Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitOr<&'_ Bits<BITS, LIMBS>> for &Bits<BITS, LIMBS>
sourceimpl<const BITS: usize, const LIMBS: usize> BitOrAssign<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitOrAssign<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourcefn bitor_assign(&mut self, rhs: &Bits<BITS, LIMBS>)
fn bitor_assign(&mut self, rhs: &Bits<BITS, LIMBS>)
Performs the |= operation. Read more
sourceimpl<const BITS: usize, const LIMBS: usize> BitOrAssign<Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitOrAssign<Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourcefn bitor_assign(&mut self, rhs: Bits<BITS, LIMBS>)
fn bitor_assign(&mut self, rhs: Bits<BITS, LIMBS>)
Performs the |= operation. Read more
sourceimpl<const BITS: usize, const LIMBS: usize> BitXor<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitXor<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourceimpl<const BITS: usize, const LIMBS: usize> BitXor<&'_ Bits<BITS, LIMBS>> for &Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitXor<&'_ Bits<BITS, LIMBS>> for &Bits<BITS, LIMBS>
sourceimpl<const BITS: usize, const LIMBS: usize> BitXorAssign<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitXorAssign<&'_ Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourcefn bitxor_assign(&mut self, rhs: &Bits<BITS, LIMBS>)
fn bitxor_assign(&mut self, rhs: &Bits<BITS, LIMBS>)
Performs the ^= operation. Read more
sourceimpl<const BITS: usize, const LIMBS: usize> BitXorAssign<Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> BitXorAssign<Bits<BITS, LIMBS>> for Bits<BITS, LIMBS>
sourcefn bitxor_assign(&mut self, rhs: Bits<BITS, LIMBS>)
fn bitxor_assign(&mut self, rhs: Bits<BITS, LIMBS>)
Performs the ^= operation. Read more
sourceimpl<const BITS: usize, const LIMBS: usize> ShlAssign<&'_ usize> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> ShlAssign<&'_ usize> for Bits<BITS, LIMBS>
sourcefn shl_assign(&mut self, rhs: &usize)
fn shl_assign(&mut self, rhs: &usize)
Performs the <<= operation. Read more
sourceimpl<const BITS: usize, const LIMBS: usize> ShlAssign<usize> for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> ShlAssign<usize> for Bits<BITS, LIMBS>
sourcefn shl_assign(&mut self, rhs: usize)
fn shl_assign(&mut self, rhs: usize)
Performs the <<= operation. Read more
Auto Trait Implementations
impl<const BITS: usize, const LIMBS: usize> RefUnwindSafe for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> Send for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> Sync for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> Unpin for Bits<BITS, LIMBS>
impl<const BITS: usize, const LIMBS: usize> UnwindSafe for Bits<BITS, LIMBS>
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