Struct BitVec

Source
pub struct BitVec<B = Vec<usize>> { /* private fields */ }
Expand description

A bit vector.

Implementations§

Source§

impl<B> BitVec<B>

Source

pub fn len(&self) -> usize

Returns the number of bits in the bit vector.

This method is equivalent to BitLength::len, but it is provided to reduce ambiguity in method resolution.

Source

pub unsafe fn from_raw_parts(bits: B, len: usize) -> Self

§Safety

len must be between 0 (included) the number of bits in bits (included).

Source

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

Source

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

Modify the bit vector in place.

§Safety

This is unsafe because it’s the caller’s responsibility to ensure that that the length is compatible with the modified bits.

Source§

impl<B: AsRef<[usize]>> BitVec<B>

Source

pub fn to_owned(&self) -> BitVec

Returns an owned copy of the bit vector.

Source

pub fn get(&self, index: usize) -> bool

Returns true if the bit of given index is set.

Source

pub unsafe fn get_unchecked(&self, index: usize) -> bool

Returns true if the bit of given index is set, without bound checks.

§Safety

index must be between 0 (included) and BitVec::len (excluded).

Source§

impl<B: AsRef<[usize]> + AsMut<[usize]>> BitVec<B>

Source

pub fn set(&mut self, index: usize, value: bool)

Source

pub unsafe fn set_unchecked(&mut self, index: usize, value: bool)

§Safety

index must be between 0 (included) and BitVec::len (excluded).

Source

pub fn fill(&mut self, value: bool)

Sets all bits to the given value.

Source

pub fn par_fill(&mut self, value: bool)

Sets all bits to the given value using a parallel implementation.

Source

pub fn reset(&mut self)

Sets all bits to zero.

Source

pub fn par_reset(&mut self)

Sets all bits to zero using a parallel implementation.

Source

pub fn flip(&mut self)

Flip all bits.

Source

pub fn par_flip(&mut self)

Flip all bits using a parallel implementation.

Source

pub fn par_count_ones(&self) -> usize

A parallel version of BitVec::count_ones.

Source§

impl BitVec<Vec<usize>>

Source

pub fn new(len: usize) -> Self

Creates a new bit vector of length len initialized to false.

Source

pub fn with_value(len: usize, value: bool) -> Self

Creates a new bit vector of length len initialized to value.

Source

pub fn with_capacity(capacity: usize) -> Self

Creates a new zero-length bit vector of given capacity.

Note that the capacity will be rounded up to a multiple of the word size.

Source

pub fn capacity(&self) -> usize

Source

pub fn push(&mut self, b: bool)

Source

pub fn pop(&mut self) -> Option<bool>

Source

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

Source§

impl<B: AsRef<[usize]>> BitVec<B>

Source

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

Source

pub fn iter_ones(&self) -> OnesIterator<'_, B>

Source

pub fn iter_zeros(&self) -> ZerosIterator<'_, B>

Trait Implementations§

Source§

impl<B> AlignHash for BitVec<B>
where B: AlignHash,

Source§

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

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

Call AlignHash::align_hash on a value.
Source§

impl<W, B: AsMut<[W]>> AsMut<[W]> for BitVec<B>

Source§

fn as_mut(&mut self) -> &mut [W]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<W, B: AsRef<[W]>> AsRef<[W]> for BitVec<B>

Source§

fn as_ref(&self) -> &[W]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<B: AsRef<[usize]>> BitCount for BitVec<B>

Source§

fn count_ones(&self) -> usize

Returns the number of ones in the underlying bit vector, with a possibly expensive computation; see NumBits::num_ones for constant-time version.
Source§

fn count_zeros(&self) -> usize

Returns the number of zeros in the underlying bit vector, with a possibly expensive computation; see NumBits::num_zeros for constant-time version.
Source§

impl<B> BitLength for BitVec<B>

Source§

fn len(&self) -> usize

Returns a length in bits.
Source§

impl<B: Clone> Clone for BitVec<B>

Source§

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

Returns a copy 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> CopyType for BitVec<B>

Source§

impl<B> CopyType for BitVec<B>
where B: MemSize, usize: MemSize,

Source§

impl<B: Debug> Debug for BitVec<B>

Source§

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

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

impl<B> DeserializeInner for BitVec<B>

Source§

type DeserType<'epserde_desertype> = BitVec<<B as DeserializeInner>::DeserType<'epserde_desertype>>

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

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

Source§

fn _deserialize_eps_inner<'deserialize_eps_inner_lifetime>( backend: &mut SliceWithPos<'deserialize_eps_inner_lifetime>, ) -> Result<Self::DeserType<'deserialize_eps_inner_lifetime>, Error>

Source§

impl<B: AsRef<[usize]>> Display for BitVec<B>

Source§

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

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

impl Extend<bool> for BitVec<Vec<usize>>

Source§

fn extend<T>(&mut self, i: T)
where T: IntoIterator<Item = bool>,

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<'a, W: IntoAtomic> From<AtomicBitVec<&'a [<W as IntoAtomic>::AtomicType]>> for BitVec<&'a [W]>

Source§

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

Converts to this type from the input type.
Source§

impl<'a, W: IntoAtomic> From<AtomicBitVec<&'a mut [<W as IntoAtomic>::AtomicType]>> for BitVec<&'a mut [W]>

Source§

fn from(value: AtomicBitVec<&'a mut [W::AtomicType]>) -> Self

Converts to this type from the input type.
Source§

impl<W: IntoAtomic> From<AtomicBitVec<Box<[<W as IntoAtomic>::AtomicType]>>> for BitVec<Box<[W]>>

Source§

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

Converts to this type from the input type.
Source§

impl<W: IntoAtomic> From<AtomicBitVec<Vec<<W as IntoAtomic>::AtomicType>>> for BitVec<Vec<W>>

Source§

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

Converts to this type from the input type.
Source§

impl<'a, W: IntoAtomic> From<BitVec<&'a [W]>> for AtomicBitVec<&'a [W::AtomicType]>

Source§

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

Converts to this type from the input type.
Source§

impl<'a, W: IntoAtomic> From<BitVec<&'a mut [W]>> for AtomicBitVec<&'a mut [W::AtomicType]>

Source§

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

Converts to this type from the input type.
Source§

impl<W: IntoAtomic> From<BitVec<Box<[W]>>> for AtomicBitVec<Box<[W::AtomicType]>>

Source§

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

Converts to this type from the input type.
Source§

impl<W> From<BitVec<Box<[W]>>> for BitVec<Vec<W>>

Source§

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

Converts to this type from the input type.
Source§

impl<W: IntoAtomic> From<BitVec<Vec<W>>> for AtomicBitVec<Vec<W::AtomicType>>

Source§

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

Converts to this type from the input type.
Source§

impl<W> From<BitVec<Vec<W>>> for BitVec<Box<[W]>>

Source§

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

Converts to this type from the input type.
Source§

impl FromIterator<bool> for BitVec<Vec<usize>>

Source§

fn from_iter<T: IntoIterator<Item = bool>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<B: AsRef<[usize]>> Index<usize> for BitVec<B>

Source§

type Output = bool

The returned type after indexing.
Source§

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

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, B: AsRef<[usize]>> IntoIterator for &'a BitVec<B>

Source§

type IntoIter = BitIterator<'a, B>

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

type Item = bool

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<B> MemDbgImpl for BitVec<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, ) -> 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, ) -> Result<(), Error>

Source§

impl<B> MemSize for BitVec<B>
where B: MemSize, usize: MemSize,

Source§

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

Returns the (recursively computed) overall memory size of the structure in bytes.
Source§

impl<B: AsRef<[usize]>, C: AsRef<[usize]>> PartialEq<BitVec<C>> for BitVec<B>

Source§

fn eq(&self, other: &BitVec<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: AsRef<[usize]>> RankHinted<64> for BitVec<B>

Source§

unsafe fn rank_hinted( &self, pos: usize, hint_pos: usize, hint_rank: usize, ) -> usize

Returns the number of ones preceding the specified position, provided a preceding position and its associated rank. Read more
Source§

impl<B: AsRef<[usize]>> SelectHinted for BitVec<B>

Source§

unsafe fn select_hinted( &self, rank: usize, hint_pos: usize, hint_rank: usize, ) -> usize

Selection the one of given rank, provided the position of a preceding one and its rank. Read more
Source§

impl<B: AsRef<[usize]>> SelectZeroHinted for BitVec<B>

Source§

unsafe fn select_zero_hinted( &self, rank: usize, hint_pos: usize, hint_rank: usize, ) -> usize

Selection the zero of given rank, provided the position of a preceding zero and its rank. Read more
Source§

impl<B> SerializeInner for BitVec<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§

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§

type SerType = BitVec<<B as SerializeInner>::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§

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

Serialize this structure using the given backend.
Source§

impl<B> TypeHash for BitVec<B>
where B: TypeHash,

Source§

fn type_hash(hasher: &mut impl Hasher)

Accumulate type information in hasher.
Source§

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

Call TypeHash::type_hash on a value.
Source§

impl Eq for BitVec<Vec<usize>>

Auto Trait Implementations§

§

impl<B> Freeze for BitVec<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for BitVec<B>
where B: RefUnwindSafe,

§

impl<B> Send for BitVec<B>
where B: Send,

§

impl<B> Sync for BitVec<B>
where B: Sync,

§

impl<B> Unpin for BitVec<B>
where B: Unpin,

§

impl<B> UnwindSafe for BitVec<B>
where B: 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> AtomicBitFieldSlice<u16> for T
where T: AsRef<[AtomicU16]>,

Source§

unsafe fn get_atomic_unchecked(&self, index: usize, order: Ordering) -> u16

Returns the value at the specified index. Read more
Source§

unsafe fn set_atomic_unchecked(&self, index: usize, value: u16, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

fn reset_atomic(&mut self, order: Ordering)

Sets all values to zero. Read more
Source§

fn par_reset_atomic(&mut self, order: Ordering)

Sets all values to zero using a parallel implementation. Read more
Source§

fn get_atomic(&self, index: usize, order: Ordering) -> W

Returns the value at the specified index. Read more
Source§

fn set_atomic(&self, index: usize, value: W, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

impl<T> AtomicBitFieldSlice<u32> for T
where T: AsRef<[AtomicU32]>,

Source§

unsafe fn get_atomic_unchecked(&self, index: usize, order: Ordering) -> u32

Returns the value at the specified index. Read more
Source§

unsafe fn set_atomic_unchecked(&self, index: usize, value: u32, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

fn reset_atomic(&mut self, order: Ordering)

Sets all values to zero. Read more
Source§

fn par_reset_atomic(&mut self, order: Ordering)

Sets all values to zero using a parallel implementation. Read more
Source§

fn get_atomic(&self, index: usize, order: Ordering) -> W

Returns the value at the specified index. Read more
Source§

fn set_atomic(&self, index: usize, value: W, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

impl<T> AtomicBitFieldSlice<u64> for T
where T: AsRef<[AtomicU64]>,

Source§

unsafe fn get_atomic_unchecked(&self, index: usize, order: Ordering) -> u64

Returns the value at the specified index. Read more
Source§

unsafe fn set_atomic_unchecked(&self, index: usize, value: u64, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

fn reset_atomic(&mut self, order: Ordering)

Sets all values to zero. Read more
Source§

fn par_reset_atomic(&mut self, order: Ordering)

Sets all values to zero using a parallel implementation. Read more
Source§

fn get_atomic(&self, index: usize, order: Ordering) -> W

Returns the value at the specified index. Read more
Source§

fn set_atomic(&self, index: usize, value: W, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

impl<T> AtomicBitFieldSlice<u8> for T
where T: AsRef<[AtomicU8]>,

Source§

unsafe fn get_atomic_unchecked(&self, index: usize, order: Ordering) -> u8

Returns the value at the specified index. Read more
Source§

unsafe fn set_atomic_unchecked(&self, index: usize, value: u8, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

fn reset_atomic(&mut self, order: Ordering)

Sets all values to zero. Read more
Source§

fn par_reset_atomic(&mut self, order: Ordering)

Sets all values to zero using a parallel implementation. Read more
Source§

fn get_atomic(&self, index: usize, order: Ordering) -> W

Returns the value at the specified index. Read more
Source§

fn set_atomic(&self, index: usize, value: W, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

impl<T> AtomicBitFieldSlice<usize> for T
where T: AsRef<[AtomicUsize]>,

Source§

unsafe fn get_atomic_unchecked(&self, index: usize, order: Ordering) -> usize

Returns the value at the specified index. Read more
Source§

unsafe fn set_atomic_unchecked( &self, index: usize, value: usize, order: Ordering, )

Sets the element of the slice at the specified index. Read more
Source§

fn reset_atomic(&mut self, order: Ordering)

Sets all values to zero. Read more
Source§

fn par_reset_atomic(&mut self, order: Ordering)

Sets all values to zero using a parallel implementation. Read more
Source§

fn get_atomic(&self, index: usize, order: Ordering) -> W

Returns the value at the specified index. Read more
Source§

fn set_atomic(&self, index: usize, value: W, order: Ordering)

Sets the element of the slice at the specified index. Read more
Source§

impl<T, W> AtomicHelper<W> for T

Source§

unsafe fn get_unchecked(&self, index: usize, order: Ordering) -> W

Source§

fn get(&self, index: usize, order: Ordering) -> W

Source§

unsafe fn set_unchecked(&self, index: usize, value: W, order: Ordering)

Source§

fn set(&self, index: usize, value: W, order: Ordering)

Source§

fn reset(&mut self, order: Ordering)

Source§

impl<T> BitFieldSlice<u128> for T
where T: AsRef<[u128]>,

Source§

unsafe fn get_unchecked(&self, index: usize) -> u128

Returns the value at the specified index. Read more
Source§

fn get(&self, index: usize) -> W

Returns the value at the specified index. Read more
Source§

impl<T> BitFieldSlice<u16> for T
where T: AsRef<[u16]>,

Source§

unsafe fn get_unchecked(&self, index: usize) -> u16

Returns the value at the specified index. Read more
Source§

fn get(&self, index: usize) -> W

Returns the value at the specified index. Read more
Source§

impl<T> BitFieldSlice<u32> for T
where T: AsRef<[u32]>,

Source§

unsafe fn get_unchecked(&self, index: usize) -> u32

Returns the value at the specified index. Read more
Source§

fn get(&self, index: usize) -> W

Returns the value at the specified index. Read more
Source§

impl<T> BitFieldSlice<u64> for T
where T: AsRef<[u64]>,

Source§

unsafe fn get_unchecked(&self, index: usize) -> u64

Returns the value at the specified index. Read more
Source§

fn get(&self, index: usize) -> W

Returns the value at the specified index. Read more
Source§

impl<T> BitFieldSlice<u8> for T
where T: AsRef<[u8]>,

Source§

unsafe fn get_unchecked(&self, index: usize) -> u8

Returns the value at the specified index. Read more
Source§

fn get(&self, index: usize) -> W

Returns the value at the specified index. Read more
Source§

impl<T> BitFieldSlice<usize> for T
where T: AsRef<[usize]>,

Source§

unsafe fn get_unchecked(&self, index: usize) -> usize

Returns the value at the specified index. Read more
Source§

fn get(&self, index: usize) -> W

Returns the value at the specified index. Read more
Source§

impl<T> BitFieldSliceCore<AtomicU16> for T
where T: AsRef<[AtomicU16]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<AtomicU32> for T
where T: AsRef<[AtomicU32]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<AtomicU64> for T
where T: AsRef<[AtomicU64]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<AtomicU8> for T
where T: AsRef<[AtomicU8]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<AtomicUsize> for T
where T: AsRef<[AtomicUsize]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<i128> for T
where T: AsRef<[i128]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<i16> for T
where T: AsRef<[i16]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<i32> for T
where T: AsRef<[i32]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<i64> for T
where T: AsRef<[i64]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<i8> for T
where T: AsRef<[i8]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<isize> for T
where T: AsRef<[isize]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<u128> for T
where T: AsRef<[u128]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<u16> for T
where T: AsRef<[u16]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<u32> for T
where T: AsRef<[u32]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<u64> for T
where T: AsRef<[u64]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<u8> for T
where T: AsRef<[u8]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceCore<usize> for T
where T: AsRef<[usize]>,

Source§

fn bit_width(&self) -> usize

Returns the width of the slice. Read more
Source§

fn len(&self) -> usize

Returns the length of the slice.
Source§

fn is_empty(&self) -> bool

Returns true if the slice has length zero.
Source§

impl<T> BitFieldSliceMut<u128> for T
where T: AsMut<[u128]> + AsRef<[u128]>,

Source§

type ChunksMut<'a> = ChunksMut<'a, u128> where T: 'a

Source§

unsafe fn set_unchecked(&mut self, index: usize, value: u128)

Sets the element of the slice at the specified index. No bounds checking is performed. Read more
Source§

fn reset(&mut self)

Sets all values to zero.
Source§

fn par_reset(&mut self)

Sets all values to zero using a parallel implementation.
Source§

fn copy(&self, from: usize, dst: &mut T, to: usize, len: usize)

Copy part of the content of the vector to another vector. Read more
Source§

fn try_chunks_mut( &mut self, chunk_size: usize, ) -> Result<<T as BitFieldSliceMut<u128>>::ChunksMut<'_>, ()>

Tries and returns an iterator over non-overlapping mutable chunks of a bit-field slice, starting at the beginning of the slice. Read more
Source§

fn as_mut_slice(&mut self) -> &mut [u128]

Returns the backend of the slice as a mutable slice of W.
Source§

fn mask(&self) -> W

Returns the mask to apply to values to ensure they fit in bit_width bits.
Source§

fn set(&mut self, index: usize, value: W)

Sets the element of the slice at the specified index. Read more
Source§

unsafe fn apply_in_place_unchecked<F>(&mut self, f: F)
where F: FnMut(W) -> W, Self: BitFieldSlice<W>,

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

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

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

impl<T> BitFieldSliceMut<u16> for T
where T: AsMut<[u16]> + AsRef<[u16]>,

Source§

type ChunksMut<'a> = ChunksMut<'a, u16> where T: 'a

Source§

unsafe fn set_unchecked(&mut self, index: usize, value: u16)

Sets the element of the slice at the specified index. No bounds checking is performed. Read more
Source§

fn reset(&mut self)

Sets all values to zero.
Source§

fn par_reset(&mut self)

Sets all values to zero using a parallel implementation.
Source§

fn copy(&self, from: usize, dst: &mut T, to: usize, len: usize)

Copy part of the content of the vector to another vector. Read more
Source§

fn try_chunks_mut( &mut self, chunk_size: usize, ) -> Result<<T as BitFieldSliceMut<u16>>::ChunksMut<'_>, ()>

Tries and returns an iterator over non-overlapping mutable chunks of a bit-field slice, starting at the beginning of the slice. Read more
Source§

fn as_mut_slice(&mut self) -> &mut [u16]

Returns the backend of the slice as a mutable slice of W.
Source§

fn mask(&self) -> W

Returns the mask to apply to values to ensure they fit in bit_width bits.
Source§

fn set(&mut self, index: usize, value: W)

Sets the element of the slice at the specified index. Read more
Source§

unsafe fn apply_in_place_unchecked<F>(&mut self, f: F)
where F: FnMut(W) -> W, Self: BitFieldSlice<W>,

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

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

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

impl<T> BitFieldSliceMut<u32> for T
where T: AsMut<[u32]> + AsRef<[u32]>,

Source§

type ChunksMut<'a> = ChunksMut<'a, u32> where T: 'a

Source§

unsafe fn set_unchecked(&mut self, index: usize, value: u32)

Sets the element of the slice at the specified index. No bounds checking is performed. Read more
Source§

fn reset(&mut self)

Sets all values to zero.
Source§

fn par_reset(&mut self)

Sets all values to zero using a parallel implementation.
Source§

fn copy(&self, from: usize, dst: &mut T, to: usize, len: usize)

Copy part of the content of the vector to another vector. Read more
Source§

fn try_chunks_mut( &mut self, chunk_size: usize, ) -> Result<<T as BitFieldSliceMut<u32>>::ChunksMut<'_>, ()>

Tries and returns an iterator over non-overlapping mutable chunks of a bit-field slice, starting at the beginning of the slice. Read more
Source§

fn as_mut_slice(&mut self) -> &mut [u32]

Returns the backend of the slice as a mutable slice of W.
Source§

fn mask(&self) -> W

Returns the mask to apply to values to ensure they fit in bit_width bits.
Source§

fn set(&mut self, index: usize, value: W)

Sets the element of the slice at the specified index. Read more
Source§

unsafe fn apply_in_place_unchecked<F>(&mut self, f: F)
where F: FnMut(W) -> W, Self: BitFieldSlice<W>,

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

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

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

impl<T> BitFieldSliceMut<u64> for T
where T: AsMut<[u64]> + AsRef<[u64]>,

Source§

type ChunksMut<'a> = ChunksMut<'a, u64> where T: 'a

Source§

unsafe fn set_unchecked(&mut self, index: usize, value: u64)

Sets the element of the slice at the specified index. No bounds checking is performed. Read more
Source§

fn reset(&mut self)

Sets all values to zero.
Source§

fn par_reset(&mut self)

Sets all values to zero using a parallel implementation.
Source§

fn copy(&self, from: usize, dst: &mut T, to: usize, len: usize)

Copy part of the content of the vector to another vector. Read more
Source§

fn try_chunks_mut( &mut self, chunk_size: usize, ) -> Result<<T as BitFieldSliceMut<u64>>::ChunksMut<'_>, ()>

Tries and returns an iterator over non-overlapping mutable chunks of a bit-field slice, starting at the beginning of the slice. Read more
Source§

fn as_mut_slice(&mut self) -> &mut [u64]

Returns the backend of the slice as a mutable slice of W.
Source§

fn mask(&self) -> W

Returns the mask to apply to values to ensure they fit in bit_width bits.
Source§

fn set(&mut self, index: usize, value: W)

Sets the element of the slice at the specified index. Read more
Source§

unsafe fn apply_in_place_unchecked<F>(&mut self, f: F)
where F: FnMut(W) -> W, Self: BitFieldSlice<W>,

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

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

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

impl<T> BitFieldSliceMut<u8> for T
where T: AsMut<[u8]> + AsRef<[u8]>,

Source§

type ChunksMut<'a> = ChunksMut<'a, u8> where T: 'a

Source§

unsafe fn set_unchecked(&mut self, index: usize, value: u8)

Sets the element of the slice at the specified index. No bounds checking is performed. Read more
Source§

fn reset(&mut self)

Sets all values to zero.
Source§

fn par_reset(&mut self)

Sets all values to zero using a parallel implementation.
Source§

fn copy(&self, from: usize, dst: &mut T, to: usize, len: usize)

Copy part of the content of the vector to another vector. Read more
Source§

fn try_chunks_mut( &mut self, chunk_size: usize, ) -> Result<<T as BitFieldSliceMut<u8>>::ChunksMut<'_>, ()>

Tries and returns an iterator over non-overlapping mutable chunks of a bit-field slice, starting at the beginning of the slice. Read more
Source§

fn as_mut_slice(&mut self) -> &mut [u8]

Returns the backend of the slice as a mutable slice of W.
Source§

fn mask(&self) -> W

Returns the mask to apply to values to ensure they fit in bit_width bits.
Source§

fn set(&mut self, index: usize, value: W)

Sets the element of the slice at the specified index. Read more
Source§

unsafe fn apply_in_place_unchecked<F>(&mut self, f: F)
where F: FnMut(W) -> W, Self: BitFieldSlice<W>,

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

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

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

impl<T> BitFieldSliceMut<usize> for T
where T: AsMut<[usize]> + AsRef<[usize]>,

Source§

type ChunksMut<'a> = ChunksMut<'a, usize> where T: 'a

Source§

unsafe fn set_unchecked(&mut self, index: usize, value: usize)

Sets the element of the slice at the specified index. No bounds checking is performed. Read more
Source§

fn reset(&mut self)

Sets all values to zero.
Source§

fn par_reset(&mut self)

Sets all values to zero using a parallel implementation.
Source§

fn copy(&self, from: usize, dst: &mut T, to: usize, len: usize)

Copy part of the content of the vector to another vector. Read more
Source§

fn try_chunks_mut( &mut self, chunk_size: usize, ) -> Result<<T as BitFieldSliceMut<usize>>::ChunksMut<'_>, ()>

Tries and returns an iterator over non-overlapping mutable chunks of a bit-field slice, starting at the beginning of the slice. Read more
Source§

fn as_mut_slice(&mut self) -> &mut [usize]

Returns the backend of the slice as a mutable slice of W.
Source§

fn mask(&self) -> W

Returns the mask to apply to values to ensure they fit in bit_width bits.
Source§

fn set(&mut self, index: usize, value: W)

Sets the element of the slice at the specified index. Read more
Source§

unsafe fn apply_in_place_unchecked<F>(&mut self, f: F)
where F: FnMut(W) -> W, Self: BitFieldSlice<W>,

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

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

Applies a function to all elements of the slice in place. 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> CastableFrom<T> for T

Source§

fn cast_from(value: T) -> T

Call Self as W
Source§

impl<T, U> CastableInto<U> for T
where U: CastableFrom<T>,

Source§

fn cast(self) -> U

Call W::cast_from(self)
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<T> Deserialize for T

Source§

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>

ε-copy deserialize a structure of this type from the given backend.
Source§

fn load_full(path: impl AsRef<Path>) -> Result<Self, Error>

Convenience method to fully deserialize from a file.
Source§

fn load_mem<'a>( path: impl AsRef<Path>, ) -> Result<MemCase<Self::DeserType<'a>>, Error>

Load a file into heap-allocated memory and ε-deserialize a data structure from it, returning a MemCase containing the data structure and the memory. Excess bytes are zeroed out. Read more
Source§

fn load_mmap<'a>( path: impl AsRef<Path>, flags: Flags, ) -> Result<MemCase<Self::DeserType<'a>>, Error>

Load a file into mmap()-allocated memory and ε-deserialize a data structure from it, returning a MemCase containing the data structure and the memory. Excess bytes are zeroed out. Read more
Source§

fn mmap<'a>( path: impl AsRef<Path>, flags: Flags, ) -> Result<MemCase<Self::DeserType<'a>>, Error>

Memory map a file and ε-deserialize a data structure from it, returning a MemCase containing the data structure and the memory mapping. Read more
Source§

impl<T> DowncastableFrom<T> for T

Source§

fn downcast_from(value: T) -> T

Truncate the current UnsignedInt to a possibly smaller size
Source§

impl<T, U> DowncastableInto<U> for T
where U: DowncastableFrom<T>,

Source§

fn downcast(self) -> U

Call W::downcast_from(self)
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>

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

Writes to a core::fmt::Write debug infos about the structure memory usage, expanding all levels of nested structures.
Source§

fn mem_dbg_depth(&self, max_depth: usize, flags: DbgFlags) -> Result<(), Error>

Writes to stderr debug infos 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 infos 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> Splat<T> for T

Source§

fn splat(value: T) -> T

Source§

impl<T> To<T> for T

Source§

fn to(self) -> T

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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> UpcastableFrom<T> for T

Source§

fn upcast_from(value: T) -> T

Extend the current UnsignedInt to a possibly bigger size.
Source§

impl<T, U> UpcastableInto<U> for T
where U: UpcastableFrom<T>,

Source§

fn upcast(self) -> U

Call W::upcast_from(self)
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeepCopy for T
where T: CopyType<Copy = Deep>,