Skip to main content

BitFieldVec

Struct BitFieldVec 

Source
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>

Source

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).

Source

pub fn into_raw_parts(self) -> (B, usize, usize)

Returns the backend, the bit width, and the length, consuming this vector.

Source

pub const fn mask(&self) -> B::Word

Returns the mask used to extract values from the vector. This will keep the lowest bit_width bits.

Source

pub unsafe fn map<B2: Backend<Word: Word>>( self, f: impl FnOnce(B) -> B2, ) -> BitFieldVec<B2>

Replaces the backend by applying a function, consuming this vector.

§Safety

The caller must ensure that the length is compatible with the new backend.

Source§

impl<B: Backend<Word: Word> + AsRef<[B::Word]>> BitFieldVec<B>

Source

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.

Source

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.

Source

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

pub fn as_slice(&self) -> &[B::Word]

Returns the backend of the vector as a slice of words.

Source§

impl<W: Word> BitFieldVec<Vec<W>>

Source

pub fn new(bit_width: usize, len: usize) -> Self

Creates a new zero-initialized vector of given bit width and length.

Source

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.

Source

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.

Source

pub fn clear(&mut self)

Sets len to 0.

Source

pub const fn bit_width(&self) -> usize

Returns the bit width of the values inside the vector.

Source

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.

Source

pub fn push(&mut self, value: W)

Adds a value at the end of the vector.

Source

pub fn resize(&mut self, new_len: usize, value: W)

Truncates or extends with value the vector.

Source

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.

Source

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]>>

Source

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.

Source§

impl<B: Backend<Word: Word> + AsRef<[B::Word]>> BitFieldVec<B>

Source

pub fn iter_from(&self, from: usize) -> BitFieldVecIter<'_, B>

Source

pub fn iter(&self) -> BitFieldVecIter<'_, B>

Trait Implementations§

Source§

impl<B> AlignHash for BitFieldVec<B>
where B: SerInner<SerType: AlignHash> + Backend, usize: SerInner<SerType: AlignHash>, B::Word: SerInner<SerType: AlignHash>,

Source§

fn align_hash(hasher: &mut impl Hasher, offset_of: &mut usize)

Accumulates alignment information in hasher assuming to be positioned at offset_of.
Source§

fn align_hash_val(&self, hasher: &mut impl Hasher, offset_of: &mut usize)

Calls AlignHash::align_hash on a value.
Source§

impl<B> Backend for BitFieldVec<B>
where B: Backend + Backend,

Source§

type Word = <B as Backend>::Word

The word type used by this backend.
Source§

impl<B: Backend<Word: Word> + AsRef<[B::Word]>> BitFieldSlice for BitFieldVec<B>

Source§

fn as_slice(&self) -> &[Self::Value]

Returns the backend of the slice as a slice of Self::Value.
Source§

impl<B: Backend<Word: Word> + AsRef<[B::Word]> + AsMut<[B::Word]>> BitFieldSliceMut for BitFieldVec<B>

Source§

fn reset(&mut self)

Sets all values to zero.
Source§

fn par_reset(&mut self)

Available on crate feature rayon only.
Sets all values to zero using a parallel implementation.
Source§

fn as_mut_slice(&mut self) -> &mut [B::Word]

Returns the backend of the slice as a mutable slice of Self::Value.
Source§

impl<B: Backend<Word: Word>> BitWidth for BitFieldVec<B>

Source§

fn bit_width(&self) -> usize

Returns the bit width of the slice. Read more
Source§

impl<B: Clone + Backend> Clone for BitFieldVec<B>
where B::Word: Clone,

Source§

fn clone(&self) -> BitFieldVec<B>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B: Backend> CopyType for BitFieldVec<B>

Source§

impl<B: Debug + Backend> Debug for BitFieldVec<B>
where B::Word: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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>>

The deserialization type associated with this type. It can be retrieved conveniently with the alias DeserType.
Source§

fn __check_covariance<'__long: '__short, '__short>( proof: CovariantProof<Self::DeserType<'__long>>, ) -> CovariantProof<Self::DeserType<'__short>>

Internal method for checking the covariance of DeserType. Read more
Source§

unsafe fn _deser_full_inner( backend: &mut impl ReadWithPos, ) -> Result<Self, Error>

Safety Read more
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>

Safety Read more
Source§

impl<'de, B> Deserialize<'de> for BitFieldVec<B>
where B: Deserialize<'de> + Backend, B::Word: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<W: Word> Extend<W> for BitFieldVec<Vec<W>>

Source§

fn extend<T: IntoIterator<Item = W>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

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]>

Source§

fn from(value: AtomicBitFieldVec<&'a [W::Atomic]>) -> Self

Converts to this type from the input type.
Source§

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

Converts to this type from the input type.
Source§

impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<Box<[<W as AtomicPrimitive>::Atomic]>>> for BitFieldVec<Box<[W]>>

Source§

fn from(value: AtomicBitFieldVec<Box<[W::Atomic]>>) -> Self

Converts to this type from the input type.
Source§

impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<AtomicBitFieldVec<Vec<<W as AtomicPrimitive>::Atomic>>> for BitFieldVec<Vec<W>>

Source§

fn from(value: AtomicBitFieldVec<Vec<W::Atomic>>) -> Self

Converts to this type from the input type.
Source§

impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<BitFieldVec<Box<[W]>>> for AtomicBitFieldVec<Box<[W::Atomic]>>

Source§

fn from(value: BitFieldVec<Box<[W]>>) -> Self

Converts to this type from the input type.
Source§

impl<W: Word> From<BitFieldVec<Box<[W]>>> for BitFieldVec<Vec<W>>

Source§

fn from(value: BitFieldVec<Box<[W]>>) -> Self

Converts to this type from the input type.
Source§

impl<W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> From<BitFieldVec<Vec<W>>> for AtomicBitFieldVec<Vec<W::Atomic>>

Source§

fn from(value: BitFieldVec<Vec<W>>) -> Self

Converts to this type from the input type.
Source§

impl<W: Word> From<BitFieldVec<Vec<W>>> for BitFieldVec<Box<[W]>>

Source§

fn from(value: BitFieldVec<Vec<W>>) -> Self

Converts to this type from the input type.
Source§

impl<W: Word> From<BitFieldVecU<Box<[W]>>> for BitFieldVec<Box<[W]>>

Source§

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<B: Backend<Word: Word> + AsRef<[B::Word]>> Hash for BitFieldVec<B>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoIterator for &'a BitFieldVec<B>

Source§

type Item = <B as Backend>::Word

The type of the elements being iterated over.
Source§

type IntoIter = BitFieldVecIter<'a, B>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoIteratorFrom for &'a BitFieldVec<B>

Source§

type IntoIterFrom = BitFieldVecIter<'a, B>

The iterator type returned by into_iter_from.
Source§

fn into_iter_from(self, from: usize) -> Self::IntoIterFrom

Creates an iterator from a starting position.
Source§

impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoUncheckedBackIterator for &'a BitFieldVec<B>

Source§

type Item = <B as Backend>::Word

Source§

type IntoUncheckedIterBack = BitFieldVecUncheckedBackIter<'a, B>

Source§

fn into_unchecked_iter_back(self) -> Self::IntoUncheckedIterBack

Creates a backward unchecked iterator starting from the end.
Source§

fn into_unchecked_iter_back_from( self, from: usize, ) -> Self::IntoUncheckedIterBack

Creates a backward unchecked iterator starting from the given position.
Source§

impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IntoUncheckedIterator for &'a BitFieldVec<B>

Source§

type Item = <B as Backend>::Word

Source§

type IntoUncheckedIter = BitFieldVecUncheckedIter<'a, B>

Source§

fn into_unchecked_iter_from(self, from: usize) -> Self::IntoUncheckedIter

Creates an unchecked iterator starting from the given position.
Source§

fn into_unchecked_iter(self) -> Self::IntoUncheckedIter

Creates an unchecked iterator starting from the first position.
Source§

impl<B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValue for BitFieldVec<B>

Source§

fn iter_value(&self) -> <Self as IterateByValueGat<'_>>::Iter

Returns an iterator on values.
Source§

impl<B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueFrom for BitFieldVec<B>

Source§

fn iter_value_from(&self, from: usize) -> <Self as IterateByValueGat<'_>>::Iter

Returns an iterator on values starting at the given position.
Source§

impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueFromGat<'a> for BitFieldVec<B>

Source§

type Item = <B as Backend>::Word

The type of the items returned by the iterator.
Source§

type IterFrom = BitFieldVecIter<'a, B>

The type of the iterator returned by iter_value_from.
Source§

impl<'a, B: Backend<Word: Word> + AsRef<[B::Word]>> IterateByValueGat<'a> for BitFieldVec<B>

Source§

type Item = <B as Backend>::Word

The type of the items returned by the iterator.
Source§

type Iter = BitFieldVecIter<'a, B>

The type of the iterator returned by iter_value.
Source§

impl<B> MemDbgImpl for BitFieldVec<B>

Source§

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

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, 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>

Internal implementation for depth display. Read more
Source§

impl<B> MemSize for BitFieldVec<B>

Source§

fn mem_size_rec( &self, _memsize_flags: SizeFlags, _memsize_refs: &mut HashMap<usize, usize>, ) -> usize

Recursive implementation that tracks visited references for deduplication. Read more
Source§

fn mem_size(&self, flags: SizeFlags) -> usize

Returns the (recursively computed) overall memory size of the structure in bytes.
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.

Source§

fn eq(&self, other: &BitFieldVec<C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<B> SerInner for BitFieldVec<B>

Source§

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§

type SerType = BitFieldVec<<B as SerInner>::SerType>

This is the type that will be written in the header of the file, and thus the type that will be deserialized. In most cases it is Self, but in some cases, as for references to slices, it is customized.
Source§

unsafe fn _ser_inner(&self, backend: &mut impl WriteWithNames) -> Result<()>

Serializes this structure using the given backend. Read more
Source§

impl<B> Serialize for BitFieldVec<B>
where B: Serialize + Backend, B::Word: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<B: Backend<Word: Word> + AsRef<[B::Word]>> SliceByValue for BitFieldVec<B>

Source§

type Value = <B as Backend>::Word

The type of the values in the slice.
Source§

fn len(&self) -> usize

Source§

unsafe fn get_value_unchecked(&self, index: usize) -> B::Word

Source§

fn is_empty(&self) -> bool

Source§

fn index_value(&self, index: usize) -> Self::Value

Source§

fn get_value(&self, index: usize) -> Option<Self::Value>

Source§

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)

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)
where F: FnMut(Self::Value) -> Self::Value,

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>>

§Errors

This method will return an error if the chunk size multiplied by the bit width is not a multiple of W::BITS and more than one chunk must be returned.

Source§

type ChunksMut<'a> = ChunksMut<'a, <B as Backend>::Word> where Self: 'a

The iterator type returned by try_chunks_mut.
Source§

type ChunksMutError = ChunksMutError<<B as Backend>::Word>

The error type returned by try_chunks_mut. Read more
Source§

fn set_value(&mut self, index: usize, value: B::Word)

Sets the value at the given index to the given value. Read more
Source§

unsafe fn set_value_unchecked(&mut self, index: usize, value: B::Word)

Sets the value at the given index to the given value without doing bounds checking. Read more
Source§

fn replace_value(&mut self, index: usize, value: B::Word) -> B::Word

Sets the value at the given index to the given value and returns the previous value. Read more
Source§

unsafe fn replace_value_unchecked( &mut self, index: usize, value: B::Word, ) -> B::Word

Sets the value at the given index to the given value and returns the previous value, without doing bounds checking. Read more
Source§

fn apply_in_place<F>(&mut self, f: F)
where F: FnMut(Self::Value) -> Self::Value,

Applies a function to all elements of the slice in place. Read more
Source§

impl<'__subslice_impl, B> SliceByValueSubsliceGat<'__subslice_impl> for BitFieldVec<B>
where B: AsRef<[B::Word]> + Backend, B::Word: Word,

Source§

type Subslice = BitFieldVecSubsliceImpl<'__subslice_impl, B>

The type of the subslice.
Source§

impl<'__subslice_impl, B> SliceByValueSubsliceGatMut<'__subslice_impl> for BitFieldVec<B>
where B: AsRef<[B::Word]> + AsMut<[B::Word]> + Backend, B::Word: Word,

Source§

type SubsliceMut = BitFieldVecSubsliceImplMut<'__subslice_impl, B>

The type of the mutable subslice.
Source§

impl<B> SliceByValueSubsliceRange<Range<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRange<RangeFrom<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRange<RangeFull> for BitFieldVec<B>
where B: AsRef<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRange<RangeInclusive<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRange<RangeTo<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRange<RangeToInclusive<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRangeMut<Range<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + AsMut<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRangeMut<RangeFrom<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + AsMut<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRangeMut<RangeFull> for BitFieldVec<B>
where B: AsRef<[B::Word]> + AsMut<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRangeMut<RangeInclusive<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + AsMut<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRangeMut<RangeTo<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + AsMut<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B> SliceByValueSubsliceRangeMut<RangeToInclusive<usize>> for BitFieldVec<B>
where B: AsRef<[B::Word]> + AsMut<[B::Word]> + Backend, B::Word: Word,

Source§

impl<B: Backend<Word: Word>> TruncateHash<<B as Backend>::Word> for BitFieldVec<B>

Source§

fn truncate_hash(&self, hash: u64) -> B::Word

Returns the given hash truncated to the bit width of the stored values.
Source§

impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> TryFrom<BitFieldVec<&'a [W]>> for AtomicBitFieldVec<&'a [W::Atomic]>

Source§

type Error = CannotCastToAtomicError<W>

The type returned in the event of a conversion error.
Source§

fn try_from(value: BitFieldVec<&'a [W]>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, W: Word + AtomicPrimitive<Atomic: PrimitiveAtomicUnsigned>> TryFrom<BitFieldVec<&'a mut [W]>> for AtomicBitFieldVec<&'a mut [W::Atomic]>

Source§

type Error = CannotCastToAtomicError<W>

The type returned in the event of a conversion error.
Source§

fn try_from(value: BitFieldVec<&'a mut [W]>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<W: Word> TryIntoUnaligned for BitFieldVec<Box<[W]>>

Source§

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§

type Unaligned = BitFieldVecU<Box<[W]>>

The unaligned version of this type.
Source§

impl<B> TypeHash for BitFieldVec<B>
where B: SerInner<SerType: TypeHash> + Backend, usize: SerInner<SerType: TypeHash>, B::Word: SerInner<SerType: TypeHash>,

Source§

fn type_hash(hasher: &mut impl Hasher)

Accumulates type information in hasher.
Source§

fn type_hash_val(&self, hasher: &mut impl Hasher)

Calls TypeHash::type_hash on a value.
Source§

impl<B: Backend<Word: Word> + AsRef<[B::Word]>> Eq for BitFieldVec<B>

Auto Trait Implementations§

§

impl<B> Freeze for BitFieldVec<B>
where B: Freeze, <B as Backend>::Word: Freeze,

§

impl<B> RefUnwindSafe for BitFieldVec<B>

§

impl<B> Send for BitFieldVec<B>
where B: Send, <B as Backend>::Word: Send,

§

impl<B> Sync for BitFieldVec<B>
where B: Sync, <B as Backend>::Word: Sync,

§

impl<B> Unpin for BitFieldVec<B>
where B: Unpin, <B as Backend>::Word: Unpin,

§

impl<B> UnsafeUnpin for BitFieldVec<B>
where B: UnsafeUnpin, <B as Backend>::Word: UnsafeUnpin,

§

impl<B> UnwindSafe for BitFieldVec<B>
where B: UnwindSafe, <B as Backend>::Word: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> MemDbg for T
where T: MemDbgImpl,

Source§

fn mem_dbg(&self, flags: DbgFlags) -> Result<(), Error>

Available on crate feature std only.
Writes to stderr debug info 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>

Writes to a 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>

Available on crate feature std only.
Writes to stderr debug info about the structure memory usage as 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>

Writes to a 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.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<U> SliceByValueSubslice for U

Source§

impl<U> SliceByValueSubsliceMut for U