Struct BitFill

Source
pub struct BitFill<Block> { /* private fields */ }
Expand description

Emulates a constant-valued bit-vector of a given size.

Implementations§

Source§

impl<Block: BlockType> BitFill<Block>

Source

pub fn zeroes(len: u64) -> Self

Constructs a compact bit-vector-like of len 0s.

Source

pub fn ones(len: u64) -> Self

Constructs a compact bit-vector-like of len 1s.

Trait Implementations§

Source§

impl<'a, Block: BlockType> BitSliceable<Range<u64>> for &'a BitFill<Block>

Source§

type Slice = BitSliceAdapter<&'a BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: Range<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<Block: BlockType> BitSliceable<Range<u64>> for BitFill<Block>

Source§

type Slice = BitSliceAdapter<BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: Range<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<'a, Block: BlockType> BitSliceable<RangeFrom<u64>> for &'a BitFill<Block>

Source§

type Slice = BitSliceAdapter<&'a BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: RangeFrom<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<Block: BlockType> BitSliceable<RangeFrom<u64>> for BitFill<Block>

Source§

type Slice = BitSliceAdapter<BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: RangeFrom<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<'a, Block: BlockType> BitSliceable<RangeFull> for &'a BitFill<Block>

Source§

type Slice = BitSliceAdapter<&'a BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, _range: RangeFull) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<Block: BlockType> BitSliceable<RangeFull> for BitFill<Block>

Source§

type Slice = BitSliceAdapter<BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, _range: RangeFull) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<'a, Block: BlockType> BitSliceable<RangeInclusive<u64>> for &'a BitFill<Block>

Source§

type Slice = BitSliceAdapter<&'a BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: RangeInclusive<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<Block: BlockType> BitSliceable<RangeInclusive<u64>> for BitFill<Block>

Source§

type Slice = BitSliceAdapter<BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: RangeInclusive<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<'a, Block: BlockType> BitSliceable<RangeTo<u64>> for &'a BitFill<Block>

Source§

type Slice = BitSliceAdapter<&'a BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: RangeTo<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<Block: BlockType> BitSliceable<RangeTo<u64>> for BitFill<Block>

Source§

type Slice = BitSliceAdapter<BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: RangeTo<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<'a, Block: BlockType> BitSliceable<RangeToInclusive<u64>> for &'a BitFill<Block>

Source§

type Slice = BitSliceAdapter<&'a BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: RangeToInclusive<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<Block: BlockType> BitSliceable<RangeToInclusive<u64>> for BitFill<Block>

Source§

type Slice = BitSliceAdapter<BitFill<Block>>

The type of the slice produced.
Source§

fn bit_slice(self, range: RangeToInclusive<u64>) -> Self::Slice

Slices or re-slices the given object. Read more
Source§

impl<Block: BlockType> Bits for BitFill<Block>

Source§

type Block = Block

The underlying block type used to store the bits of the vector.
Source§

fn bit_len(&self) -> u64

The length of the slice in bits.
Source§

fn get_bit(&self, position: u64) -> bool

Gets the bit at position Read more
Source§

fn get_block(&self, position: usize) -> Self::Block

Gets the block at position, masked as necessary. Read more
Source§

fn get_raw_block(&self, position: usize) -> Self::Block

Gets the block at position, without masking. Read more
Source§

fn get_bits(&self, position: u64, len: usize) -> Self::Block

Gets count bits starting at bit index start, interpreted as a little-endian integer. Read more
Source§

fn block_len(&self) -> usize

The length of the slice in blocks.
Source§

fn to_bit_vec(&self) -> BitVec<Self::Block>

Copies the bits into a new allocated BitVec.
Source§

impl<Block: Clone> Clone for BitFill<Block>

Source§

fn clone(&self) -> BitFill<Block>

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<Block: Debug> Debug for BitFill<Block>

Source§

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

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

impl<Block: BlockType> Index<u64> for BitFill<Block>

Source§

type Output = bool

The returned type after indexing.
Source§

fn index(&self, index: u64) -> &bool

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

impl<T: Bits> PartialEq<T> for BitFill<T::Block>

Source§

fn eq(&self, other: &T) -> 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.

Auto Trait Implementations§

§

impl<Block> Freeze for BitFill<Block>
where Block: Freeze,

§

impl<Block> RefUnwindSafe for BitFill<Block>
where Block: RefUnwindSafe,

§

impl<Block> Send for BitFill<Block>
where Block: Send,

§

impl<Block> Sync for BitFill<Block>
where Block: Sync,

§

impl<Block> Unpin for BitFill<Block>
where Block: Unpin,

§

impl<Block> UnwindSafe for BitFill<Block>
where Block: 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> BitsExt for T
where T: Bits,

Source§

fn bit_concat<Other>(&self, other: Other) -> BitConcat<&Self, Other>
where Other: Bits<Block = Self::Block>,

Concatenates two bit vectors, with the bits of self followed by the bits of other.
Source§

fn into_bit_concat<Other>(self, other: Other) -> BitConcat<Self, Other>
where Self: Sized, Other: Bits<Block = Self::Block>,

Concatenates two bit vectors, with the bits of self followed by the bits of other. Read more
Source§

fn bit_pad(&self, len: u64) -> BitConcat<&Self, BitFill<Self::Block>>

Pads self with 0s on the right to reach at least len bits in length. Read more
Source§

fn into_bit_pad(self, len: u64) -> BitConcat<Self, BitFill<Self::Block>>
where Self: Sized,

Pads self with 0s on the right to reach at least len bits in length. Read more
Source§

fn bit_not(&self) -> BitNot<&Self>

Returns an object that inverts the values of all the bits in self.
Source§

fn into_bit_not(self) -> BitNot<Self>
where Self: Sized,

Returns an object that inverts the values of all the bits in self. Read more
Source§

fn bit_and<Other>(&self, other: Other) -> BitAnd<&Self, Other>
where Other: Bits<Block = Self::Block>,

Returns an object that lazily computes the bit-wise conjunction of two bit-vector-likes. Read more
Source§

fn into_bit_and<Other>(self, other: Other) -> BitAnd<Self, Other>
where Self: Sized, Other: Bits<Block = Self::Block>,

Returns an object that lazily computes the bit-wise conjunction of two bit-vector-likes. Read more
Source§

fn bit_or<Other>(&self, other: Other) -> BitOr<&Self, Other>
where Other: Bits<Block = Self::Block>,

Returns an object that lazily computes the bit-wise disjunction of two bit-vector-likes. Read more
Source§

fn into_bit_or<Other>(self, other: Other) -> BitOr<Self, Other>
where Self: Sized, Other: Bits<Block = Self::Block>,

Returns an object that lazily computes the bit-wise disjunction of two bit-vector-likes. Read more
Source§

fn bit_xor<Other>(&self, other: Other) -> BitXor<&Self, Other>
where Other: Bits<Block = Self::Block>,

Returns an object that lazily computes the bit-wise xor of two bit-vector-likes. Read more
Source§

fn into_bit_xor<Other>(self, other: Other) -> BitXor<Self, Other>
where Self: Sized, Other: Bits<Block = Self::Block>,

Returns an object that lazily computes the bit-wise xor of two bit-vector-likes. Read more
Source§

fn bit_zip<Other, F>(&self, other: Other, fun: F) -> BitZip<&Self, Other, F>
where Other: Bits<Block = Self::Block>, F: Fn(Self::Block, Self::Block, usize) -> Self::Block,

Returns an object that lazily zips a function over the blocks of two bit-vector-like. Read more
Source§

fn into_bit_zip<Other, F>(self, other: Other, fun: F) -> BitZip<Self, Other, F>
where Self: Sized, Other: Bits<Block = Self::Block>, F: Fn(Self::Block, Self::Block, usize) -> Self::Block,

Returns an object that lazily zips a function over the blocks of two bit-vector-like. 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<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> 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.