Transformation

Trait Transformation 

Source
pub trait Transformation {
    // Required methods
    fn bit(parent: &BitVector, index: usize) -> bool;
    fn word(parent: &BitVector, index: usize) -> u64;
    unsafe fn word_unchecked(parent: &BitVector, index: usize) -> u64;
    fn count_ones(parent: &BitVector) -> usize;
    fn one_iter(parent: &BitVector) -> OneIter<'_, Self> ;
}
Expand description

An implicit transformation of BitVector into another vector of the same length.

Types that implement this trait can be used as parameters for SelectSupport and OneIter.

Required Methods§

Source

fn bit(parent: &BitVector, index: usize) -> bool

Reads a bit from the transformed bitvector.

§Arguments
  • parent: The parent bitvector.
  • index: Index in the bit array.
§Panics

May panic if index is not a valid offset in the bit array.

Source

fn word(parent: &BitVector, index: usize) -> u64

Reads a 64-bit word from the transformed bitvector.

§Arguments
  • parent: The parent bitvector.
  • index: Read the word starting at offset index * 64 of the bit array.
§Panics

May panic if index * 64 is not a valid offset in the bit array.

Source

unsafe fn word_unchecked(parent: &BitVector, index: usize) -> u64

Unsafe version of Transformation::word without bounds checks.

§Safety

Behavior is undefined if index * 64 is not a valid offset in the bit array.

Source

fn count_ones(parent: &BitVector) -> usize

Returns the length of the integer array or the number of ones in the bit array of the transformed bitvector.

Source

fn one_iter(parent: &BitVector) -> OneIter<'_, Self>

Returns an iterator over the set bits in the transformed bitvector.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§