Skip to main content

BitCollection

Trait BitCollection 

Source
pub trait BitCollection {
Show 13 methods // Required methods fn new(init: BitsetInit) -> Self; fn count(&self) -> usize; fn test(&self, index: usize) -> bool; fn set(&mut self, index: usize); fn unset(&mut self, index: usize); fn is_empty(&self) -> bool; fn clear(&mut self); fn capacity(&self) -> usize; fn resize(&mut self, capacity: usize); fn intersect_with(&mut self, other: &Bitset); fn union_with(&mut self, other: &Bitset); fn count_intersect_with(&self, other: &Bitset) -> usize; fn count_interest_with_many(&self, others: &[Bitset]) -> Vec<usize>;
}
Expand description

Operations on a bitset.

Required Methods§

Source

fn new(init: BitsetInit) -> Self

A bitset of the given capacity and content.

Source

fn count(&self) -> usize

Number of elements set.

Source

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

Whether index is set.

Source

fn set(&mut self, index: usize)

Sets index.

Source

fn unset(&mut self, index: usize)

Clears index.

Source

fn is_empty(&self) -> bool

Whether no element is set.

Source

fn clear(&mut self)

Clears every element.

Source

fn capacity(&self) -> usize

Largest number of elements.

Source

fn resize(&mut self, capacity: usize)

Changes the capacity.

Source

fn intersect_with(&mut self, other: &Bitset)

Keeps only the elements also in other.

Source

fn union_with(&mut self, other: &Bitset)

Adds the elements of other.

Source

fn count_intersect_with(&self, other: &Bitset) -> usize

Size of the intersection with other.

Source

fn count_interest_with_many(&self, others: &[Bitset]) -> Vec<usize>

Size of the intersection with each of others.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§