[−][src]Struct succinct::BitVector
Uncompressed vector of bits.
Methods
impl<Block: BlockType> BitVector<Block>
[src]
pub fn new() -> Self
[src]
Creates a new, empty bit vector.
pub fn with_capacity(capacity: u64) -> Self
[src]
Creates a new, empty bit vector with space allocated for capacity
bits.
Panics
Panics if capacity
is too large. In particular the number of
blocks required by the capacity (capacity / Block::nbits()
)
must fit in a usize
.
pub fn block_with_capacity(capacity: usize) -> Self
[src]
Creates a new, empty bit vector with space allocated for capacity
blocks.
pub fn with_fill(len: u64, value: bool) -> Self
[src]
Creates a new bit vector of len
bits initialized to value
.
Panics
Panics if len
is too large. In particular the number of
blocks required by the capacity (len / Block::nbits()
)
must fit in a usize
.
pub fn block_with_fill(block_len: usize, value: Block) -> Self
[src]
Creates a new bit vector of block_len
blocks initialized to value
.
pub fn capacity(&self) -> u64
[src]
How many bits the bit vector can hold without reallocating.
pub fn block_capacity(&self) -> usize
[src]
How many blocks the bit vector can hold without reallocating.
pub fn resize(&mut self, new_len: u64, value: bool)
[src]
Resizes the bit vector to the given number of elements, filling if necessary.
Panics
Panics if new_len
is too large. In particular the number of
blocks required by the capacity (new_len / Block::nbits()
)
must fit in a usize
.
pub fn block_resize(&mut self, new_len: usize, value: Block)
[src]
Resizes the bit vector to the given number of blocks, filling if necessary.
pub fn reserve(&mut self, additional: u64)
[src]
Reserves capacity for at least additional
more bits to be
inserted.
The collection may reserve more space to avoid frequent reallocations.
Panics
Panics if the number of blocks overflows a usize
.
pub fn block_reserve(&mut self, additional: usize)
[src]
Reserves capacity for at least additional
blocks of bits to be
inserted.
The collection may reserve more space to avoid frequent reallocations.
Panics
Panics if the number of blocks overflows a usize
.
pub fn reserve_exact(&mut self, additional: u64)
[src]
Reserves capacity for at least additional
more bits to be
inserted.
Unlike reserve
, does nothing if the
capacity is already sufficient.
Panics
Panics if the number of blocks overflows a usize
.
pub fn block_reserve_exact(&mut self, additional: usize)
[src]
Reserves capacity for at least additional
more blocks of bits to be
inserted.
Unlike reserve_block
, does nothing if the
capacity is already sufficient.
Panics
Panics if the number of blocks overflows a usize
.
pub fn shrink_to_fit(&mut self)
[src]
Shrinks the capacity to just fit the number of elements.
pub fn truncate(&mut self, len: u64)
[src]
Shrinks to the given size.
Does nothing if len
is greater than the current size.
pub fn block_truncate(&mut self, block_len: usize)
[src]
Shrinks to the given size in blocks.
Does nothing if block_len
is greater than the current size in blocks.
pub fn clear(&mut self)
[src]
Sets the size to 0 while retaining the allocated storage.
ⓘImportant traits for Iter<'a, Block>pub fn iter(&self) -> Iter<Block>
[src]
Returns an iterator over the bits of the bit vector
Trait Implementations
impl<Block: BlockType> SpaceUsage for BitVector<Block>
[src]
fn is_stack_only() -> bool
[src]
fn heap_bytes(&self) -> usize
[src]
fn total_bytes(&self) -> usize
[src]
Computes the size of the receiver in bytes. Read more
fn stack_bytes() -> usize
[src]
Calculates the stack portion of the size of this type. Read more
impl<Block: BlockType> BitVec for BitVector<Block>
[src]
type Block = Block
The underlying block type used to store the bits of the vector.
fn bit_len(&self) -> u64
[src]
fn get_bit(&self, index: u64) -> bool
[src]
fn get_block(&self, index: usize) -> Block
[src]
fn block_len(&self) -> usize
[src]
The length of the slice in blocks.
fn get_bits(&self, start: u64, count: usize) -> Self::Block
[src]
Gets count
bits starting at bit index start
, interpreted as a little-endian integer. Read more
impl<Block: BlockType> BitVecMut for BitVector<Block>
[src]
fn set_bit(&mut self, index: u64, value: bool)
[src]
fn set_block(&mut self, index: usize, value: Block)
[src]
fn set_bits(&mut self, start: u64, count: usize, value: Self::Block)
[src]
Sets count
bits starting at bit index start
, interpreted as a little-endian integer. Read more
impl<Block: BlockType> BitVecPush for BitVector<Block>
[src]
fn push_bit(&mut self, value: bool)
[src]
fn pop_bit(&mut self) -> Option<bool>
[src]
fn push_block(&mut self, value: Block)
[src]
fn align_block(&mut self, value: bool)
[src]
Pushes value
0 or more times until the size of the bit vector is block-aligned. Read more
impl<Block: Ord + BlockType> Ord for BitVector<Block>
[src]
fn cmp(&self, other: &BitVector<Block>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<Block: PartialOrd + BlockType> PartialOrd<BitVector<Block>> for BitVector<Block>
[src]
fn partial_cmp(&self, other: &BitVector<Block>) -> Option<Ordering>
[src]
fn lt(&self, other: &BitVector<Block>) -> bool
[src]
fn le(&self, other: &BitVector<Block>) -> bool
[src]
fn gt(&self, other: &BitVector<Block>) -> bool
[src]
fn ge(&self, other: &BitVector<Block>) -> bool
[src]
impl<Block: PartialEq + BlockType> PartialEq<BitVector<Block>> for BitVector<Block>
[src]
fn eq(&self, other: &BitVector<Block>) -> bool
[src]
fn ne(&self, other: &BitVector<Block>) -> bool
[src]
impl<Block: BlockType> Default for BitVector<Block>
[src]
impl<'a, Block: BlockType + 'a> IntoIterator for &'a BitVector<Block>
[src]
type Item = bool
The type of the elements being iterated over.
type IntoIter = Iter<'a, Block>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<Block: Clone + BlockType> Clone for BitVector<Block>
[src]
fn clone(&self) -> BitVector<Block>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Block: Eq + BlockType> Eq for BitVector<Block>
[src]
impl<Block: Debug + BlockType> Debug for BitVector<Block>
[src]
impl<Block: Hash + BlockType> Hash for BitVector<Block>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<Block: BlockType> Binary for BitVector<Block>
[src]
Auto Trait Implementations
impl<Block> Send for BitVector<Block> where
Block: Send,
Block: Send,
impl<Block> Unpin for BitVector<Block> where
Block: Unpin,
Block: Unpin,
impl<Block> Sync for BitVector<Block> where
Block: Sync,
Block: Sync,
impl<Block> RefUnwindSafe for BitVector<Block> where
Block: RefUnwindSafe,
Block: RefUnwindSafe,
impl<Block> UnwindSafe for BitVector<Block> where
Block: UnwindSafe,
Block: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,