pub struct BitFieldVec<B: Backend = Vec<usize>> { /* private fields */ }Expand description
A vector of bit fields of fixed width (AKA “compact array”, “bit array”, etc.).
See the module documentation for more details.
Implementations§
Source§impl<B: Backend<Word: Word>> BitFieldVec<B>
impl<B: Backend<Word: Word>> BitFieldVec<B>
Sourcepub unsafe fn from_raw_parts(bits: B, bit_width: usize, len: usize) -> Self
pub unsafe fn from_raw_parts(bits: B, bit_width: usize, len: usize) -> Self
§Safety
len * bit_width must be between 0 (included) and the number of
bits in bits (included).
Sourcepub fn into_raw_parts(self) -> (B, usize, usize)
pub fn into_raw_parts(self) -> (B, usize, usize)
Returns the backend, the bit width, and the length, consuming this vector.
Source§impl<B: Backend<Word: Word> + AsRef<[B::Word]>> BitFieldVec<B>
impl<B: Backend<Word: Word> + AsRef<[B::Word]>> BitFieldVec<B>
Sourcepub fn addr_of(&self, index: usize) -> *const B::Word
pub fn addr_of(&self, index: usize) -> *const B::Word
Gets the address of the item storing (the first part of) the element of given index.
This method is mainly useful for manually prefetching parts of the data structure.
Sourcepub fn get_unaligned(&self, index: usize) -> B::Word
pub fn get_unaligned(&self, index: usize) -> B::Word
Like SliceByValue::index_value, but using unaligned reads.
This method can be used only for bit width smaller than or equal to
W::BITS as usize - 8 + 2 or equal to W::BITS as usize - 8 + 4 or W::BITS. Moreover,
an additional padding word must be present at the end of the vector.
Note that to guarantee the absence of undefined behavior this method
has to perform several tests. Consider using
get_unaligned_unchecked if you are sure that the constraints are
respected.
§Panics
This method will panic if the constraints above are not respected.
Sourcepub unsafe fn get_unaligned_unchecked(&self, index: usize) -> B::Word
pub unsafe fn get_unaligned_unchecked(&self, index: usize) -> B::Word
Like SliceByValue::get_value_unchecked, but using unaligned reads.
§Safety
This method can be used only for bit width smaller than or equal to
W::BITS as usize - 8 + 2 or equal to W::BITS as usize - 8 + 4 or W::BITS. Moreover,
an additional padding word must be present at the end of the vector,
and index must be within bounds.
§Panics
This method will panic in debug mode if the safety constraints are not respected.
Source§impl<W: Word> BitFieldVec<Vec<W>>
impl<W: Word> BitFieldVec<Vec<W>>
Sourcepub fn new(bit_width: usize, len: usize) -> Self
pub fn new(bit_width: usize, len: usize) -> Self
Creates a new zero-initialized vector of given bit width and length.
Sourcepub fn with_capacity(bit_width: usize, capacity: usize) -> Self
pub fn with_capacity(bit_width: usize, capacity: usize) -> Self
Creates an empty vector that doesn’t need to reallocate for up to
capacity elements.
Sourcepub unsafe fn set_len(&mut self, len: usize)
pub unsafe fn set_len(&mut self, len: usize)
Sets the length.
§Safety
len * bit_width must be at most self.bits.len() * W::BITS as usize. Note that
setting the length might result in reading uninitialized data.
Sourcepub fn from_slice<S: BitFieldSlice<Value: Word + PrimitiveNumberAs<W>>>(
slice: &S,
) -> Result<Self>
pub fn from_slice<S: BitFieldSlice<Value: Word + PrimitiveNumberAs<W>>>( slice: &S, ) -> Result<Self>
Creates a new vector by copying a slice; the bit width will be the minimum width sufficient to hold all values in the slice.
Returns an error if the bit width of the values in slice is larger than
W::BITS.
Sourcepub fn pop(&mut self) -> Option<W>
pub fn pop(&mut self) -> Option<W>
Removes and returns a value from the end of the vector.
Returns None if the BitFieldVec is empty.
Sourcepub fn into_padded(self) -> BitFieldVec<Box<[W]>>
pub fn into_padded(self) -> BitFieldVec<Box<[W]>>
Ensures a padding word is present at the end and converts the
backend to Box<[W]>.
The extra word ensures that unaligned reads of size_of::<W>()
bytes starting at any byte offset within the data never exceed the
allocation. If the allocation already has more words than needed
for the data, no word is added.
Source§impl<W: Word> BitFieldVec<Box<[W]>>
impl<W: Word> BitFieldVec<Box<[W]>>
Sourcepub fn new_padded(bit_width: usize, len: usize) -> Self
pub fn new_padded(bit_width: usize, len: usize) -> Self
Creates a new zero-initialized vector of given bit width and length, with a padding word at the end for safe unaligned reads.
This constructor is useful for structures implementing
TryIntoUnaligned that want to avoid reallocations.
Trait Implementations§
Source§impl<B> AlignHash for BitFieldVec<B>
impl<B> AlignHash for BitFieldVec<B>
Source§fn align_hash(hasher: &mut impl Hasher, offset_of: &mut usize)
fn align_hash(hasher: &mut impl Hasher, offset_of: &mut usize)
hasher assuming to be positioned
at offset_of.Source§fn align_hash_val(&self, hasher: &mut impl Hasher, offset_of: &mut usize)
fn align_hash_val(&self, hasher: &mut impl Hasher, offset_of: &mut usize)
AlignHash::align_hash on a value.Source§impl<B> Backend for BitFieldVec<B>
impl<B> Backend for BitFieldVec<B>
Source§impl<B: Backend<Word: Word> + AsRef<[B::Word]>> BitFieldSlice for BitFieldVec<B>
impl<B: Backend<Word: Word> + AsRef<[B::Word]>> BitFieldSlice for BitFieldVec<B>
Source§impl<B: Backend<Word: Word> + AsRef<[B::Word]> + AsMut<[B::Word]>> BitFieldSliceMut for BitFieldVec<B>
impl<B: Backend<Word: Word> + AsRef<[B::Word]> + AsMut<[B::Word]>> BitFieldSliceMut for BitFieldVec<B>
Source§impl<B: Clone + Backend> Clone for BitFieldVec<B>
impl<B: Clone + Backend> Clone for BitFieldVec<B>
Source§fn clone(&self) -> BitFieldVec<B>
fn clone(&self) -> BitFieldVec<B>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<B> DeserInner for BitFieldVec<B>where
B: DeserInner + Backend,
usize: DeserInner,
B::Word: DeserInner,
for<'a> <B as DeserInner>::DeserType<'a>: Backend<Word = B::Word>,
for<'__epserde_desertype> DeserType<'__epserde_desertype, B>: Backend,
impl<B> DeserInner for BitFieldVec<B>where
B: DeserInner + Backend,
usize: DeserInner,
B::Word: DeserInner,
for<'a> <B as DeserInner>::DeserType<'a>: Backend<Word = B::Word>,
for<'__epserde_desertype> DeserType<'__epserde_desertype, B>: Backend,
Source§type DeserType<'__epserde_desertype> = BitFieldVec<<B as DeserInner>::DeserType<'__epserde_desertype>>
type DeserType<'__epserde_desertype> = BitFieldVec<<B as DeserInner>::DeserType<'__epserde_desertype>>
DeserType.Source§fn __check_covariance<'__long: '__short, '__short>(
proof: CovariantProof<Self::DeserType<'__long>>,
) -> CovariantProof<Self::DeserType<'__short>>
fn __check_covariance<'__long: '__short, '__short>( proof: CovariantProof<Self::DeserType<'__long>>, ) -> CovariantProof<Self::DeserType<'__short>>
Source§unsafe fn _deser_full_inner(
backend: &mut impl ReadWithPos,
) -> Result<Self, Error>
unsafe fn _deser_full_inner( backend: &mut impl ReadWithPos, ) -> Result<Self, Error>
Source§unsafe fn _deser_eps_inner<'deser_eps_inner_lifetime>(
backend: &mut SliceWithPos<'deser_eps_inner_lifetime>,
) -> Result<Self::DeserType<'deser_eps_inner_lifetime>, Error>
unsafe fn _deser_eps_inner<'deser_eps_inner_lifetime>( backend: &mut SliceWithPos<'deser_eps_inner_lifetime>, ) -> Result<Self::DeserType<'deser_eps_inner_lifetime>, Error>
Source§impl<'de, B> Deserialize<'de> for BitFieldVec<B>
impl<'de, B> Deserialize<'de> for BitFieldVec<B>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<W: Word> Extend<W> for BitFieldVec<Vec<W>>
impl<W: Word> Extend<W> for BitFieldVec<Vec<W>>
Source§fn extend<T: IntoIterator<Item = W>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = W>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<B> FlatType for BitFieldVec<B>
impl<B> FlatType for BitFieldVec<B>
Source§impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<&'a [<W as AtomicPrimitive>::Atomic]>> for BitFieldVec<&'a [W]>
impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<&'a [<W as AtomicPrimitive>::Atomic]>> for BitFieldVec<&'a [W]>
Source§fn from(value: AtomicBitFieldVec<&'a [W::Atomic]>) -> Self
fn from(value: AtomicBitFieldVec<&'a [W::Atomic]>) -> Self
Source§impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<&'a mut [<W as AtomicPrimitive>::Atomic]>> for BitFieldVec<&'a mut [W]>
impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<&'a mut [<W as AtomicPrimitive>::Atomic]>> for BitFieldVec<&'a mut [W]>
Source§fn from(value: AtomicBitFieldVec<&'a mut [W::Atomic]>) -> Self
fn from(value: AtomicBitFieldVec<&'a mut [W::Atomic]>) -> Self
Source§impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<Box<[<W as AtomicPrimitive>::Atomic]>>> for BitFieldVec<Box<[W]>>
impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<Box<[<W as AtomicPrimitive>::Atomic]>>> for BitFieldVec<Box<[W]>>
Source§impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<Vec<<W as AtomicPrimitive>::Atomic>>> for BitFieldVec<Vec<W>>
impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<Vec<<W as AtomicPrimitive>::Atomic>>> for BitFieldVec<Vec<W>>
Source§impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<BitFieldVec<Box<[W]>>> for AtomicBitFieldVec<Box<[W::Atomic]>>
impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<BitFieldVec<Box<[W]>>> for AtomicBitFieldVec<Box<[W::Atomic]>>
Source§impl<W: Word> From<BitFieldVec<Box<[W]>>> for BitFieldVec<Vec<W>>
impl<W: Word> From<BitFieldVec<Box<[W]>>> for BitFieldVec<Vec<W>>
Source§impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<BitFieldVec<Vec<W>>> for AtomicBitFieldVec<Vec<W::Atomic>>
impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<BitFieldVec<Vec<W>>> for AtomicBitFieldVec<Vec<W::Atomic>>
Source§fn from(value: BitFieldVec<Vec<W>>) -> Self
fn from(value: BitFieldVec<Vec<W>>) -> Self
Source§impl<W: Word> From<BitFieldVec<Vec<W>>> for BitFieldVec<Box<[W]>>
impl<W: Word> From<BitFieldVec<Vec<W>>> for BitFieldVec<Box<[W]>>
Source§fn from(value: BitFieldVec<Vec<W>>) -> Self
fn from(value: BitFieldVec<Vec<W>>) -> Self
Source§impl<W: Word> From<BitFieldVecU<Box<[W]>>> for BitFieldVec<Box<[W]>>
impl<W: Word> From<BitFieldVecU<Box<[W]>>> for BitFieldVec<Box<[W]>>
Source§fn from(unaligned: BitFieldVecU<Box<[W]>>) -> Self
fn from(unaligned: BitFieldVecU<Box<[W]>>) -> Self
Converts a BitFieldVecU back into a BitFieldVec.
The padding word is kept in the backing storage so that a
subsequent try_into_unaligned does not need to reallocate.
Source§impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoIterator for &'a BitFieldVec<B>
impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoIterator for &'a BitFieldVec<B>
Source§impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoIteratorFrom for &'a BitFieldVec<B>
impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoIteratorFrom for &'a BitFieldVec<B>
Source§type IntoIterFrom = BitFieldVecIter<'a, B>
type IntoIterFrom = BitFieldVecIter<'a, B>
into_iter_from.Source§fn into_iter_from(self, from: usize) -> Self::IntoIterFrom
fn into_iter_from(self, from: usize) -> Self::IntoIterFrom
Source§impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoUncheckedBackIterator for &'a BitFieldVec<B>
impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoUncheckedBackIterator for &'a BitFieldVec<B>
type Item = <B as Backend>::Word
type IntoUncheckedIterBack = BitFieldVecUncheckedBackIter<'a, B>
Source§fn into_unchecked_iter_back(self) -> Self::IntoUncheckedIterBack
fn into_unchecked_iter_back(self) -> Self::IntoUncheckedIterBack
Source§fn into_unchecked_iter_back_from(
self,
from: usize,
) -> Self::IntoUncheckedIterBack
fn into_unchecked_iter_back_from( self, from: usize, ) -> Self::IntoUncheckedIterBack
Source§impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoUncheckedIterator for &'a BitFieldVec<B>
impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoUncheckedIterator for &'a BitFieldVec<B>
type Item = <B as Backend>::Word
type IntoUncheckedIter = BitFieldVecUncheckedIter<'a, B>
Source§fn into_unchecked_iter_from(self, from: usize) -> Self::IntoUncheckedIter
fn into_unchecked_iter_from(self, from: usize) -> Self::IntoUncheckedIter
Source§fn into_unchecked_iter(self) -> Self::IntoUncheckedIter
fn into_unchecked_iter(self) -> Self::IntoUncheckedIter
Source§impl<B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValue for BitFieldVec<B>
impl<B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValue for BitFieldVec<B>
Source§fn iter_value(&self) -> <Self as IterateByValueGat<'_>>::Iter
fn iter_value(&self) -> <Self as IterateByValueGat<'_>>::Iter
Source§impl<B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueFrom for BitFieldVec<B>
impl<B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueFrom for BitFieldVec<B>
Source§fn iter_value_from(&self, from: usize) -> <Self as IterateByValueGat<'_>>::Iter
fn iter_value_from(&self, from: usize) -> <Self as IterateByValueGat<'_>>::Iter
Source§impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueFromGat<'a> for BitFieldVec<B>
impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueFromGat<'a> for BitFieldVec<B>
Source§type IterFrom = BitFieldVecIter<'a, B>
type IterFrom = BitFieldVecIter<'a, B>
iter_value_from.Source§impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueGat<'a> for BitFieldVec<B>
impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueGat<'a> for BitFieldVec<B>
Source§type Iter = BitFieldVecIter<'a, B>
type Iter = BitFieldVecIter<'a, B>
iter_value.Source§impl<B> MemDbgImpl for BitFieldVec<B>where
B: MemDbgImpl + FlatType + Backend,
usize: MemDbgImpl + FlatType,
B::Word: MemDbgImpl + FlatType,
impl<B> MemDbgImpl for BitFieldVec<B>where
B: MemDbgImpl + FlatType + Backend,
usize: MemDbgImpl + FlatType,
B::Word: MemDbgImpl + FlatType,
fn _mem_dbg_rec_on( &self, _memdbg_writer: &mut impl Write, _memdbg_total_size: usize, _memdbg_max_depth: usize, _memdbg_prefix: &mut String, _memdbg_is_last: bool, _memdbg_flags: DbgFlags, _memdbg_refs: &mut HashSet<usize>, ) -> Result
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, padded_size: usize, flags: DbgFlags, dbg_refs: &mut HashSet<usize>, ) -> Result<(), Error>
Source§fn _mem_dbg_depth_on_impl(
&self,
writer: &mut impl Write,
total_size: usize,
max_depth: usize,
prefix: &mut String,
field_name: Option<&str>,
is_last: bool,
padded_size: usize,
flags: DbgFlags,
dbg_refs: &mut HashSet<usize>,
ref_display: RefDisplay,
) -> Result<(), Error>
fn _mem_dbg_depth_on_impl( &self, writer: &mut impl Write, total_size: usize, max_depth: usize, prefix: &mut String, field_name: Option<&str>, is_last: bool, padded_size: usize, flags: DbgFlags, dbg_refs: &mut HashSet<usize>, ref_display: RefDisplay, ) -> Result<(), Error>
Source§impl<B> MemSize for BitFieldVec<B>
impl<B> MemSize for BitFieldVec<B>
Source§impl<B: Backend<Word: Word> + AsRef<[B::Word]>, C: Backend<Word = B::Word> + AsRef<[B::Word]>> PartialEq<BitFieldVec<C>> for BitFieldVec<B>
Equality between bit-field vectors requires that the word is the same, the
bit width is the same, and the content is the same.
impl<B: Backend<Word: Word> + AsRef<[B::Word]>, C: Backend<Word = B::Word> + AsRef<[B::Word]>> PartialEq<BitFieldVec<C>> for BitFieldVec<B>
Equality between bit-field vectors requires that the word is the same, the bit width is the same, and the content is the same.
Source§impl<B> SerInner for BitFieldVec<B>
impl<B> SerInner for BitFieldVec<B>
Source§const IS_ZERO_COPY: bool
const IS_ZERO_COPY: bool
ZeroCopy type has this constant set to false
serialization will panic.Source§type SerType = BitFieldVec<<B as SerInner>::SerType>
type SerType = BitFieldVec<<B as SerInner>::SerType>
Self, but
in some cases, as for references to slices,
it is customized.Source§unsafe fn _ser_inner(&self, backend: &mut impl WriteWithNames) -> Result<()>
unsafe fn _ser_inner(&self, backend: &mut impl WriteWithNames) -> Result<()>
Source§impl<B> Serialize for BitFieldVec<B>
impl<B> Serialize for BitFieldVec<B>
Source§impl<B: Backend<Word: Word> + AsRef<[B::Word]>> SliceByValue for BitFieldVec<B>
impl<B: Backend<Word: Word> + AsRef<[B::Word]>> SliceByValue for BitFieldVec<B>
Source§fn len(&self) -> usize
fn len(&self) -> usize
slice::len.Source§unsafe fn get_value_unchecked(&self, index: usize) -> B::Word
unsafe fn get_value_unchecked(&self, index: usize) -> B::Word
Source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
slice::is_empty.Source§fn index_value(&self, index: usize) -> Self::Value
fn index_value(&self, index: usize) -> Self::Value
Source§impl<B: Backend<Word: Word> + AsRef<[B::Word]> + AsMut<[B::Word]>> SliceByValueMut for BitFieldVec<B>
impl<B: Backend<Word: Word> + AsRef<[B::Word]> + AsMut<[B::Word]>> SliceByValueMut for BitFieldVec<B>
Source§fn copy(&self, from: usize, dst: &mut Self, to: usize, len: usize)
fn copy(&self, from: usize, dst: &mut Self, to: usize, len: usize)
This implementation performs the copy word by word, which is significantly faster than the default implementation.
Source§unsafe fn apply_in_place_unchecked<F>(&mut self, f: F)
unsafe fn apply_in_place_unchecked<F>(&mut self, f: F)
This implementation keeps a buffer of W::BITS bits for reading and
writing, obtaining a significant speedup with respect to the default
implementation.
Source§fn try_chunks_mut(
&mut self,
chunk_size: usize,
) -> Result<Self::ChunksMut<'_>, ChunksMutError<B::Word>>
fn try_chunks_mut( &mut self, chunk_size: usize, ) -> Result<Self::ChunksMut<'_>, ChunksMutError<B::Word>>
Source§type ChunksMut<'a> = ChunksMut<'a, <B as Backend>::Word>
where
Self: 'a
type ChunksMut<'a> = ChunksMut<'a, <B as Backend>::Word> where Self: 'a
try_chunks_mut.Source§type ChunksMutError = ChunksMutError<<B as Backend>::Word>
type ChunksMutError = ChunksMutError<<B as Backend>::Word>
try_chunks_mut. Read moreSource§fn set_value(&mut self, index: usize, value: B::Word)
fn set_value(&mut self, index: usize, value: B::Word)
Source§unsafe fn set_value_unchecked(&mut self, index: usize, value: B::Word)
unsafe fn set_value_unchecked(&mut self, index: usize, value: B::Word)
Source§fn replace_value(&mut self, index: usize, value: B::Word) -> B::Word
fn replace_value(&mut self, index: usize, value: B::Word) -> B::Word
Source§impl<'__subslice_impl, B> SliceByValueSubsliceGat<'__subslice_impl> for BitFieldVec<B>
impl<'__subslice_impl, B> SliceByValueSubsliceGat<'__subslice_impl> for BitFieldVec<B>
Source§type Subslice = BitFieldVecSubsliceImpl<'__subslice_impl, B>
type Subslice = BitFieldVecSubsliceImpl<'__subslice_impl, B>
Source§impl<'__subslice_impl, B> SliceByValueSubsliceGatMut<'__subslice_impl> for BitFieldVec<B>
impl<'__subslice_impl, B> SliceByValueSubsliceGatMut<'__subslice_impl> for BitFieldVec<B>
Source§type SubsliceMut = BitFieldVecSubsliceImplMut<'__subslice_impl, B>
type SubsliceMut = BitFieldVecSubsliceImplMut<'__subslice_impl, B>
Source§impl<B> SliceByValueSubsliceRange<Range<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRange<Range<usize>> for BitFieldVec<B>
Source§fn index_subslice(&self, range: R) -> Self::Subslice
fn index_subslice(&self, range: R) -> Self::Subslice
Source§fn get_subslice(&self, range: R) -> Option<Self::Subslice>
fn get_subslice(&self, range: R) -> Option<Self::Subslice>
slice::get.Source§impl<B> SliceByValueSubsliceRange<RangeFrom<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRange<RangeFrom<usize>> for BitFieldVec<B>
Source§fn index_subslice(&self, range: R) -> Self::Subslice
fn index_subslice(&self, range: R) -> Self::Subslice
Source§fn get_subslice(&self, range: R) -> Option<Self::Subslice>
fn get_subslice(&self, range: R) -> Option<Self::Subslice>
slice::get.Source§impl<B> SliceByValueSubsliceRange<RangeFull> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRange<RangeFull> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked(&self, range: RangeFull) -> Subslice<'_, Self>
unsafe fn get_subslice_unchecked(&self, range: RangeFull) -> Subslice<'_, Self>
Source§fn index_subslice(&self, range: R) -> Self::Subslice
fn index_subslice(&self, range: R) -> Self::Subslice
Source§fn get_subslice(&self, range: R) -> Option<Self::Subslice>
fn get_subslice(&self, range: R) -> Option<Self::Subslice>
slice::get.Source§impl<B> SliceByValueSubsliceRange<RangeInclusive<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRange<RangeInclusive<usize>> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked(
&self,
range: RangeInclusive<usize>,
) -> Subslice<'_, Self>
unsafe fn get_subslice_unchecked( &self, range: RangeInclusive<usize>, ) -> Subslice<'_, Self>
Source§fn index_subslice(&self, range: R) -> Self::Subslice
fn index_subslice(&self, range: R) -> Self::Subslice
Source§fn get_subslice(&self, range: R) -> Option<Self::Subslice>
fn get_subslice(&self, range: R) -> Option<Self::Subslice>
slice::get.Source§impl<B> SliceByValueSubsliceRange<RangeTo<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRange<RangeTo<usize>> for BitFieldVec<B>
Source§fn index_subslice(&self, range: R) -> Self::Subslice
fn index_subslice(&self, range: R) -> Self::Subslice
Source§fn get_subslice(&self, range: R) -> Option<Self::Subslice>
fn get_subslice(&self, range: R) -> Option<Self::Subslice>
slice::get.Source§impl<B> SliceByValueSubsliceRange<RangeToInclusive<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRange<RangeToInclusive<usize>> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked(
&self,
range: RangeToInclusive<usize>,
) -> Subslice<'_, Self>
unsafe fn get_subslice_unchecked( &self, range: RangeToInclusive<usize>, ) -> Subslice<'_, Self>
Source§fn index_subslice(&self, range: R) -> Self::Subslice
fn index_subslice(&self, range: R) -> Self::Subslice
Source§fn get_subslice(&self, range: R) -> Option<Self::Subslice>
fn get_subslice(&self, range: R) -> Option<Self::Subslice>
slice::get.Source§impl<B> SliceByValueSubsliceRangeMut<Range<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRangeMut<Range<usize>> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked_mut(
&mut self,
range: Range<usize>,
) -> SubsliceMut<'_, Self>
unsafe fn get_subslice_unchecked_mut( &mut self, range: Range<usize>, ) -> SubsliceMut<'_, Self>
Source§fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
Source§fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
slice::get.Source§impl<B> SliceByValueSubsliceRangeMut<RangeFrom<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRangeMut<RangeFrom<usize>> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked_mut(
&mut self,
range: RangeFrom<usize>,
) -> SubsliceMut<'_, Self>
unsafe fn get_subslice_unchecked_mut( &mut self, range: RangeFrom<usize>, ) -> SubsliceMut<'_, Self>
Source§fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
Source§fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
slice::get.Source§impl<B> SliceByValueSubsliceRangeMut<RangeFull> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRangeMut<RangeFull> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked_mut(
&mut self,
range: RangeFull,
) -> SubsliceMut<'_, Self>
unsafe fn get_subslice_unchecked_mut( &mut self, range: RangeFull, ) -> SubsliceMut<'_, Self>
Source§fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
Source§fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
slice::get.Source§impl<B> SliceByValueSubsliceRangeMut<RangeInclusive<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRangeMut<RangeInclusive<usize>> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked_mut(
&mut self,
range: RangeInclusive<usize>,
) -> SubsliceMut<'_, Self>
unsafe fn get_subslice_unchecked_mut( &mut self, range: RangeInclusive<usize>, ) -> SubsliceMut<'_, Self>
Source§fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
Source§fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
slice::get.Source§impl<B> SliceByValueSubsliceRangeMut<RangeTo<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRangeMut<RangeTo<usize>> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked_mut(
&mut self,
range: RangeTo<usize>,
) -> SubsliceMut<'_, Self>
unsafe fn get_subslice_unchecked_mut( &mut self, range: RangeTo<usize>, ) -> SubsliceMut<'_, Self>
Source§fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
Source§fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
slice::get.Source§impl<B> SliceByValueSubsliceRangeMut<RangeToInclusive<usize>> for BitFieldVec<B>
impl<B> SliceByValueSubsliceRangeMut<RangeToInclusive<usize>> for BitFieldVec<B>
Source§unsafe fn get_subslice_unchecked_mut(
&mut self,
range: RangeToInclusive<usize>,
) -> SubsliceMut<'_, Self>
unsafe fn get_subslice_unchecked_mut( &mut self, range: RangeToInclusive<usize>, ) -> SubsliceMut<'_, Self>
Source§fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
fn index_subslice_mut(&mut self, range: R) -> Self::SubsliceMut
Source§fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
fn get_subslice_mut(&mut self, range: R) -> Option<Self::SubsliceMut>
slice::get.Source§impl<B: Backend<Word: Word>> TruncateHash<<B as Backend>::Word> for BitFieldVec<B>
impl<B: Backend<Word: Word>> TruncateHash<<B as Backend>::Word> for BitFieldVec<B>
Source§fn truncate_hash(&self, hash: u64) -> B::Word
fn truncate_hash(&self, hash: u64) -> B::Word
Source§impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> TryFrom<BitFieldVec<&'a [W]>> for AtomicBitFieldVec<&'a [W::Atomic]>
impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> TryFrom<BitFieldVec<&'a [W]>> for AtomicBitFieldVec<&'a [W::Atomic]>
Source§impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> TryFrom<BitFieldVec<&'a mut [W]>> for AtomicBitFieldVec<&'a mut [W::Atomic]>
impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> TryFrom<BitFieldVec<&'a mut [W]>> for AtomicBitFieldVec<&'a mut [W::Atomic]>
Source§impl<W: Word> TryIntoUnaligned for BitFieldVec<Box<[W]>>
impl<W: Word> TryIntoUnaligned for BitFieldVec<Box<[W]>>
Source§fn try_into_unaligned(self) -> Result<Self::Unaligned, UnalignedConversionError>
fn try_into_unaligned(self) -> Result<Self::Unaligned, UnalignedConversionError>
Converts a BitFieldVec into a BitFieldVecU, adding a
padding word at the end if one is not already present.
§Errors
Returns an error if the bit width does not satisfy the constraints of
BitFieldVec::get_unaligned_unchecked: it must be at most
W::BITS - 6, or exactly W::BITS - 4, or exactly W::BITS.
Source§impl<B> TypeHash for BitFieldVec<B>
impl<B> TypeHash for BitFieldVec<B>
Source§fn type_hash_val(&self, hasher: &mut impl Hasher)
fn type_hash_val(&self, hasher: &mut impl Hasher)
TypeHash::type_hash on a value.impl<B: Backend<Word: Word> + AsRef<[B::Word]>> Eq for BitFieldVec<B>
Auto Trait Implementations§
impl<B> Freeze for BitFieldVec<B>
impl<B> RefUnwindSafe for BitFieldVec<B>
impl<B> Send for BitFieldVec<B>
impl<B> Sync for BitFieldVec<B>
impl<B> Unpin for BitFieldVec<B>
impl<B> UnsafeUnpin for BitFieldVec<B>
impl<B> UnwindSafe for BitFieldVec<B>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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>
std only.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>
core::fmt::Write debug info about the structure memory
usage, expanding all levels of nested structures.Source§fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>
fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>
std only.mem_dbg, but expanding only up to max_depth
levels of nested structures.Source§fn mem_dbg_depth_on(
&self,
writer: &mut impl Write,
max_depth: usize,
flags: DbgFlags,
) -> Result<(), Error>
fn mem_dbg_depth_on( &self, writer: &mut impl Write, max_depth: usize, flags: DbgFlags, ) -> Result<(), Error>
core::fmt::Write debug info about the structure memory
usage as mem_dbg_on, but expanding only up to
max_depth levels of nested structures.