pub trait BitBlock:
BitAnd<Output = Self>
+ BitAndAssign
+ BitOr<Output = Self>
+ BitOrAssign
+ BitXor<Output = Self>
+ BitXorAssign
+ Eq
+ PartialEq
+ MaybeSerialize
+ for<'de> MaybeDeserialize<'de>
+ Debug
+ Sized
+ Copy
+ Clone {
type BitsIter: BitQueue;
type BytesArray: PrimitiveArray<Item = u8>;
const SIZE_POT_EXPONENT: usize;
Show 16 methods
// Required methods
fn zero() -> Self;
fn into_bits_iter(self) -> Self::BitsIter;
fn as_array(&self) -> &[u64];
fn as_array_mut(&mut self) -> &mut [u64];
fn to_ne_bytes(self) -> Self::BytesArray;
fn to_le_bytes(self) -> Self::BytesArray;
fn from_ne_bytes(bytes: Self::BytesArray) -> Self;
fn from_le_bytes(bytes: Self::BytesArray) -> Self;
// Provided methods
fn size() -> usize { ... }
fn is_zero(&self) -> bool { ... }
unsafe fn set_bit_unchecked<const BIT: bool>(
&mut self,
bit_index: usize,
) -> bool { ... }
unsafe fn get_bit_unchecked(&self, bit_index: usize) -> bool { ... }
fn traverse_bits<F, B>(&self, f: F) -> ControlFlow<B>
where F: FnMut(usize) -> ControlFlow<B> { ... }
fn for_each_bit<F>(&self, f: F)
where F: FnMut(usize) { ... }
fn to_le(self) -> Self { ... }
fn count_ones(&self) -> usize { ... }
}Required Associated Constants§
Sourceconst SIZE_POT_EXPONENT: usize
const SIZE_POT_EXPONENT: usize
2^N bits
Required Associated Types§
type BitsIter: BitQueue
type BytesArray: PrimitiveArray<Item = u8>
Required Methods§
fn zero() -> Self
fn into_bits_iter(self) -> Self::BitsIter
fn as_array(&self) -> &[u64]
fn as_array_mut(&mut self) -> &mut [u64]
fn to_ne_bytes(self) -> Self::BytesArray
fn to_le_bytes(self) -> Self::BytesArray
fn from_ne_bytes(bytes: Self::BytesArray) -> Self
fn from_le_bytes(bytes: Self::BytesArray) -> Self
Provided Methods§
fn is_zero(&self) -> bool
Sourceunsafe fn set_bit_unchecked<const BIT: bool>(
&mut self,
bit_index: usize,
) -> bool
unsafe fn set_bit_unchecked<const BIT: bool>( &mut self, bit_index: usize, ) -> bool
Sourceunsafe fn get_bit_unchecked(&self, bit_index: usize) -> bool
unsafe fn get_bit_unchecked(&self, bit_index: usize) -> bool
§Safety
bit_index must be < SIZE
Sourcefn traverse_bits<F, B>(&self, f: F) -> ControlFlow<B>
fn traverse_bits<F, B>(&self, f: F) -> ControlFlow<B>
fn for_each_bit<F>(&self, f: F)
fn to_le(self) -> Self
fn count_ones(&self) -> usize
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl BitBlock for u64
impl BitBlock for u64
const SIZE_POT_EXPONENT: usize = 6usize
type BitsIter = PrimitiveBitQueue<u64>
type BytesArray = [u8; 8]
fn zero() -> Self
unsafe fn set_bit_unchecked<const BIT: bool>( &mut self, bit_index: usize, ) -> bool
unsafe fn get_bit_unchecked(&self, bit_index: usize) -> bool
fn traverse_bits<F, B>(&self, f: F) -> ControlFlow<B>
fn into_bits_iter(self) -> Self::BitsIter
fn as_array(&self) -> &[u64]
fn as_array_mut(&mut self) -> &mut [u64]
fn to_ne_bytes(self) -> Self::BytesArray
fn to_le_bytes(self) -> Self::BytesArray
fn from_ne_bytes(bytes: Self::BytesArray) -> Self
fn from_le_bytes(bytes: Self::BytesArray) -> Self
Source§impl BitBlock for u64x2
Available on crate feature simd only.
impl BitBlock for u64x2
Available on crate feature
simd only.const SIZE_POT_EXPONENT: usize = 7usize
type BitsIter = ArrayBitQueue<u64, 2>
type BytesArray = [u8; 16]
fn zero() -> Self
fn is_zero(&self) -> bool
fn into_bits_iter(self) -> Self::BitsIter
fn as_array(&self) -> &[u64]
fn as_array_mut(&mut self) -> &mut [u64]
fn to_ne_bytes(self) -> Self::BytesArray
fn to_le_bytes(self) -> Self::BytesArray
fn from_ne_bytes(bytes: Self::BytesArray) -> Self
fn from_le_bytes(bytes: Self::BytesArray) -> Self
Source§impl BitBlock for u64x4
Available on crate feature simd only.
impl BitBlock for u64x4
Available on crate feature
simd only.