pub trait PartitionRead<L: Level> {
// Required methods
fn cardinality(&self) -> usize;
fn is_empty(&self) -> bool;
fn contains(&self, value: L::Value) -> bool;
fn position(&self, value: L::Value) -> Option<usize>;
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>;
fn contains_all<R: RangeBounds<L::Value>>(&self, values: R) -> bool;
fn contains_any<R: RangeBounds<L::Value>>(&self, values: R) -> bool;
// Provided method
fn range<R>(&self, range: R) -> impl Iterator<Item = L::Value>
where R: RangeBounds<L::Value> + Clone { ... }
}Required Methods§
Sourcefn cardinality(&self) -> usize
fn cardinality(&self) -> usize
the total number of values accessible via this partition.
Sourcefn contains(&self, value: L::Value) -> bool
fn contains(&self, value: L::Value) -> bool
returns true if this partition contains the given value
Sourcefn position(&self, value: L::Value) -> Option<usize>
fn position(&self, value: L::Value) -> Option<usize>
returns the 0-based position of the value in the partition if it exists, otherwise returns None.
Sourcefn rank(&self, value: L::Value) -> usize
fn rank(&self, value: L::Value) -> usize
returns the number of values contained in this partition up to and including the value.
Sourcefn iter(&self) -> impl Iterator<Item = L::Value>
fn iter(&self) -> impl Iterator<Item = L::Value>
returns an iterator over all values in this partition
Sourcefn contains_all<R: RangeBounds<L::Value>>(&self, values: R) -> bool
fn contains_all<R: RangeBounds<L::Value>>(&self, values: R) -> bool
returns true if this partition contains all values in the given range
Sourcefn contains_any<R: RangeBounds<L::Value>>(&self, values: R) -> bool
fn contains_any<R: RangeBounds<L::Value>>(&self, values: R) -> bool
returns true if this partition has a non-empty intersection with the given range
Provided Methods§
Sourcefn range<R>(&self, range: R) -> impl Iterator<Item = L::Value>where
R: RangeBounds<L::Value> + Clone,
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.