Struct sux::bits::bit_vec::CountBitVec
source · pub struct CountBitVec<B = Vec<usize>> { /* private fields */ }
Expand description
An immutable bit vector with a constant-time implementation of BitCount
.
Implementations§
source§impl<B> CountBitVec<B>
impl<B> CountBitVec<B>
sourcepub unsafe fn from_raw_parts(data: B, len: usize, number_of_ones: usize) -> Self
pub unsafe fn from_raw_parts(data: B, len: usize, number_of_ones: usize) -> Self
§Safety
len
must be between 0 (included) the number of
bits in data
(included). No test is performed
on the number of ones.
pub fn into_raw_parts(self) -> (B, usize, usize)
Trait Implementations§
source§impl<B> BitCount for CountBitVec<B>
impl<B> BitCount for CountBitVec<B>
source§impl<B> BitLength for CountBitVec<B>
impl<B> BitLength for CountBitVec<B>
source§impl<B: Clone> Clone for CountBitVec<B>
impl<B: Clone> Clone for CountBitVec<B>
source§fn clone(&self) -> CountBitVec<B>
fn clone(&self) -> CountBitVec<B>
Returns a copy 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<B> ConvertTo<BitVec<B>> for CountBitVec<B>
impl<B> ConvertTo<BitVec<B>> for CountBitVec<B>
Forget the number of ones.
fn convert_to(self) -> Result<BitVec<B>>
source§impl<B, D> ConvertTo<CountBitVec<D>> for CountBitVec<B>where
B: ConvertTo<D>,
impl<B, D> ConvertTo<CountBitVec<D>> for CountBitVec<B>where
B: ConvertTo<D>,
Provide conversion betweeen bit vectors whose backends are convertible into one another.
Many implementations of this trait are then used to
implement by delegation a corresponding From
.
fn convert_to(self) -> Result<CountBitVec<D>>
source§impl ConvertTo<CountBitVec> for BitVec<Vec<usize>>
impl ConvertTo<CountBitVec> for BitVec<Vec<usize>>
Compute the number of ones and return a CountBitVec
.
fn convert_to(self) -> Result<CountBitVec<Vec<usize>>>
source§impl<B: Debug> Debug for CountBitVec<B>
impl<B: Debug> Debug for CountBitVec<B>
source§impl<B> DeserializeInner for CountBitVec<B>
impl<B> DeserializeInner for CountBitVec<B>
fn _deserialize_full_inner( backend: &mut impl ReadWithPos ) -> Result<Self, Error>
§type DeserType<'epserde_desertype> = CountBitVec<<B as DeserializeInner>::DeserType<'epserde_desertype>>
type DeserType<'epserde_desertype> = CountBitVec<<B as DeserializeInner>::DeserType<'epserde_desertype>>
The deserialization type associated with this type. It can be
retrieved conveniently with the alias
DeserType
.fn _deserialize_eps_inner<'a>( backend: &mut SliceWithPos<'a> ) -> Result<Self::DeserType<'a>, Error>
source§impl From<BitVec> for CountBitVec<Vec<usize>>
impl From<BitVec> for CountBitVec<Vec<usize>>
Compute the number of ones and return a CountBitVec
.
source§impl<B> From<CountBitVec<B>> for BitVec<B>
impl<B> From<CountBitVec<B>> for BitVec<B>
Forget the number of ones.
source§fn from(cb: CountBitVec<B>) -> Self
fn from(cb: CountBitVec<B>) -> Self
Converts to this type from the input type.
source§impl<B> MemDbgImpl for CountBitVec<B>
impl<B> MemDbgImpl for CountBitVec<B>
source§impl<B> MemSize for CountBitVec<B>
impl<B> MemSize for CountBitVec<B>
source§impl<B: ReprHash> ReprHash for CountBitVec<B>
impl<B: ReprHash> ReprHash for CountBitVec<B>
source§impl<B: AsRef<[usize]>> SelectHinted for CountBitVec<B>
impl<B: AsRef<[usize]>> SelectHinted for CountBitVec<B>
source§impl<B: AsRef<[usize]>> SelectZero for CountBitVec<B>
impl<B: AsRef<[usize]>> SelectZero for CountBitVec<B>
source§impl<B: AsRef<[usize]>> SelectZeroHinted for CountBitVec<B>
impl<B: AsRef<[usize]>> SelectZeroHinted for CountBitVec<B>
source§impl<B> SerializeInner for CountBitVec<B>
impl<B> SerializeInner for CountBitVec<B>
source§const IS_ZERO_COPY: bool = _
const IS_ZERO_COPY: bool = _
Inner constant used by the derive macros to keep
track recursively of whether the type
satisfies the conditions for being zero-copy. It is checked
at runtime against the trait implemented by the type, and
if a
ZeroCopy
type has this constant set to false
serialization will panic.source§const ZERO_COPY_MISMATCH: bool = _
const ZERO_COPY_MISMATCH: bool = _
Inner constant used by the derive macros to keep
track of whether all fields of a type are zero-copy
but neither the attribute
#[zero_copy]
nor the attribute #[deep_copy]
was specified. It is checked at runtime, and if it is true
a warning will be issued, as the type could be zero-copy,
which would be more efficient.source§fn _serialize_inner(&self, backend: &mut impl WriteWithNames) -> Result<()>
fn _serialize_inner(&self, backend: &mut impl WriteWithNames) -> Result<()>
Serialize this structure using the given backend.
source§impl<B: TypeHash> TypeHash for CountBitVec<B>
impl<B: TypeHash> TypeHash for CountBitVec<B>
source§fn type_hash_val(&self, hasher: &mut impl Hasher)
fn type_hash_val(&self, hasher: &mut impl Hasher)
Call
TypeHash::type_hash
on a value.Auto Trait Implementations§
impl<B> Freeze for CountBitVec<B>where
B: Freeze,
impl<B> RefUnwindSafe for CountBitVec<B>where
B: RefUnwindSafe,
impl<B> Send for CountBitVec<B>where
B: Send,
impl<B> Sync for CountBitVec<B>where
B: Sync,
impl<B> Unpin for CountBitVec<B>where
B: Unpin,
impl<B> UnwindSafe for CountBitVec<B>where
B: UnwindSafe,
Blanket Implementations§
source§impl<T> BitFieldSlice<usize> for T
impl<T> BitFieldSlice<usize> for T
source§impl<T> BitFieldSliceCore<usize> for T
impl<T> BitFieldSliceCore<usize> for T
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
source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
source§impl<B, const LOG2_ONES_PER_INVENTORY: usize> ConvertTo<SelectFixed1<B, Vec<usize>, LOG2_ONES_PER_INVENTORY>> for B
impl<B, const LOG2_ONES_PER_INVENTORY: usize> ConvertTo<SelectFixed1<B, Vec<usize>, LOG2_ONES_PER_INVENTORY>> for B
fn convert_to( self ) -> Result<SelectFixed1<B, Vec<usize>, LOG2_ONES_PER_INVENTORY>, Error>
source§impl<B, const LOG2_ONES_PER_INVENTORY: usize, const LOG2_U64_PER_SUBINVENTORY: usize> ConvertTo<SelectFixed2<B, Vec<u64>, LOG2_ONES_PER_INVENTORY, LOG2_U64_PER_SUBINVENTORY>> for B
impl<B, const LOG2_ONES_PER_INVENTORY: usize, const LOG2_U64_PER_SUBINVENTORY: usize> ConvertTo<SelectFixed2<B, Vec<u64>, LOG2_ONES_PER_INVENTORY, LOG2_U64_PER_SUBINVENTORY>> for B
fn convert_to( self ) -> Result<SelectFixed2<B, Vec<u64>, LOG2_ONES_PER_INVENTORY, LOG2_U64_PER_SUBINVENTORY>, Error>
source§impl<B, const LOG2_ZEROS_PER_INVENTORY: usize> ConvertTo<SelectZeroFixed1<B, Vec<usize>, LOG2_ZEROS_PER_INVENTORY>> for B
impl<B, const LOG2_ZEROS_PER_INVENTORY: usize> ConvertTo<SelectZeroFixed1<B, Vec<usize>, LOG2_ZEROS_PER_INVENTORY>> for B
fn convert_to( self ) -> Result<SelectZeroFixed1<B, Vec<usize>, LOG2_ZEROS_PER_INVENTORY>, Error>
source§impl<B, const LOG2_ZEROS_PER_INVENTORY: usize, const LOG2_U64_PER_SUBINVENTORY: usize> ConvertTo<SelectZeroFixed2<B, Vec<u64>, LOG2_ZEROS_PER_INVENTORY, LOG2_U64_PER_SUBINVENTORY>> for B
impl<B, const LOG2_ZEROS_PER_INVENTORY: usize, const LOG2_U64_PER_SUBINVENTORY: usize> ConvertTo<SelectZeroFixed2<B, Vec<u64>, LOG2_ZEROS_PER_INVENTORY, LOG2_U64_PER_SUBINVENTORY>> for B
fn convert_to( self ) -> Result<SelectZeroFixed2<B, Vec<u64>, LOG2_ZEROS_PER_INVENTORY, LOG2_U64_PER_SUBINVENTORY>, Error>
source§impl<T> Deserialize for T
impl<T> Deserialize for T
source§fn deserialize_full(backend: &mut impl ReadNoStd) -> Result<T, Error>
fn deserialize_full(backend: &mut impl ReadNoStd) -> Result<T, Error>
Fully deserialize a structure of this type from the given backend.
source§fn deserialize_eps(
backend: &[u8]
) -> Result<<T as DeserializeInner>::DeserType<'_>, Error>
fn deserialize_eps( backend: &[u8] ) -> Result<<T as DeserializeInner>::DeserType<'_>, Error>
ε-copy deserialize a structure of this type from the given backend.
source§fn load_full(path: impl AsRef<Path>) -> Result<Self, Error>
fn load_full(path: impl AsRef<Path>) -> Result<Self, Error>
Commodity method to fully deserialize from a file.
source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
source§impl<T> MemDbg for Twhere
T: MemDbgImpl,
impl<T> MemDbg for Twhere
T: MemDbgImpl,
source§fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>
Write to stdout debug infos about the structure memory usage, expanding
all levels of nested structures.
source§fn mem_dbg_on(
&self,
writer: &mut impl Write,
flags: DbgFlags
) -> Result<(), Error>
fn mem_dbg_on( &self, writer: &mut impl Write, flags: DbgFlags ) -> Result<(), Error>
Write to a
core::fmt::Write
debug infos about the structure memory usage,
expanding all levels of nested structures.source§fn mem_dbg_depth(
&self,
total_size: usize,
max_depth: usize,
flags: DbgFlags
) -> Result<(), Error>
fn mem_dbg_depth( &self, total_size: usize, max_depth: usize, flags: DbgFlags ) -> Result<(), Error>
Write to stdout debug infos about the structure memory usage, but expanding only
up to
max_depth
levels of nested structures.source§fn mem_dbg_depth_on(
&self,
writer: &mut impl Write,
total_size: usize,
max_depth: usize,
prefix: &mut String,
field_name: Option<&str>,
is_last: bool,
flags: DbgFlags
) -> Result<(), Error>
fn mem_dbg_depth_on( &self, writer: &mut impl Write, total_size: usize, max_depth: usize, prefix: &mut String, field_name: Option<&str>, is_last: bool, flags: DbgFlags ) -> Result<(), Error>
Write to a
core::fmt::Write
debug infos about the structure memory usage,
but expanding only up to max_depth
levels of nested structures.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> Serialize for T
impl<T> Serialize for T
source§fn serialize_on_field_write(
&self,
backend: &mut impl WriteWithNames
) -> Result<(), Error>
fn serialize_on_field_write( &self, backend: &mut impl WriteWithNames ) -> Result<(), Error>
Serialize the type using the given WriteWithNames
.
source§fn serialize(&self, backend: &mut impl WriteNoStd) -> Result<usize, Error>
fn serialize(&self, backend: &mut impl WriteNoStd) -> Result<usize, Error>
Serialize the type using the given backend.
source§fn serialize_with_schema(
&self,
backend: &mut impl WriteNoStd
) -> Result<Schema, Error>
fn serialize_with_schema( &self, backend: &mut impl WriteNoStd ) -> Result<Schema, Error>
source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.