PartitionRead

Trait PartitionRead 

Source
pub trait PartitionRead<L: Level> {
    // Required methods
    fn cardinality(&self) -> usize;
    fn is_empty(&self) -> bool;
    fn contains(&self, value: L::Value) -> bool;
    fn rank(&self, value: L::Value) -> usize;
    fn select(&self, idx: usize) -> Option<L::Value>;
    fn last(&self) -> Option<L::Value>;
    fn iter(&self) -> impl Iterator<Item = L::Value>;

    // Provided method
    fn range<R>(&self, range: R) -> impl Iterator<Item = L::Value>
       where R: RangeBounds<L::Value> + Clone { ... }
}

Required Methods§

Source

fn cardinality(&self) -> usize

the total number of values accessible via this partition.

Source

fn is_empty(&self) -> bool

returns true if this partition is empty

Source

fn contains(&self, value: L::Value) -> bool

returns true if this partition contains the given value

Source

fn rank(&self, value: L::Value) -> usize

returns the number of values contained in this partition up to and including the value.

Source

fn select(&self, idx: usize) -> Option<L::Value>

returns the value at position idx.

Source

fn last(&self) -> Option<L::Value>

returns the last value in the partition

Source

fn iter(&self) -> impl Iterator<Item = L::Value>

returns an iterator over all values in this partition

Provided Methods§

Source

fn range<R>(&self, range: R) -> impl Iterator<Item = L::Value>
where R: RangeBounds<L::Value> + Clone,

returns an iterator over all values in this partition restricted by the provided range.

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§