pub struct RsVectorBuilder { /* private fields */ }
Expand description

A builder for FastBitVector. This is used to efficiently construct a BitVector by appending bits to it. Once all bits have been appended, the BitVector can be built using the build method. If the number of bits to be appended is known in advance, it is recommended to use with_capacity to avoid re-allocations. If bits are already available in little endian u64 words, those words can be appended using append_word.

Implementations§

source§

impl RsVectorBuilder

source

pub fn new() -> RsVectorBuilder

Create a new empty BitVectorBuilder.

source

pub fn with_capacity(capacity: usize) -> RsVectorBuilder

Create a new empty BitVectorBuilder with the specified initial capacity to avoid re-allocations. The capacity is measured in bits

source

pub fn append_bit<T>(&mut self, bit: T)where T: Into<u64>,

Append a bit to the vector.

source

pub fn append_word(&mut self, word: u64)

Append a word to the vector. The word is assumed to be in little endian, i.e. the least significant bit is the first bit.

source§

impl RsVectorBuilder

A trait to be implemented for each bit vector type to specify how it is built from a BitVectorBuilder.

source

pub fn build(self) -> RsVec

Build the BitVector from all bits that have been appended so far. This will consume the BitVectorBuilder.

source

pub fn from_bit_vec(vec: BitVec) -> RsVec

Build a BitVector from a BitVec. This will consume the BitVec.

Trait Implementations§

source§

impl Clone for RsVectorBuilder

source§

fn clone(&self) -> RsVectorBuilder

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 Debug for RsVectorBuilder

source§

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

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

impl Default for RsVectorBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.