Type Alias bao_tree::ChunkRanges

source ·
pub type ChunkRanges = RangeSet2<ChunkNum>;
Expand description

A set of chunk ranges

Aliased Type§

struct ChunkRanges(/* private fields */);

Methods from Deref<Target = RangeSetRef<T>>§

source

pub fn split(&self, at: T) -> (&RangeSetRef<T>, &RangeSetRef<T>)where T: Ord,

Split this range set into two parts left, right at position at, so that left is identical to self for all x < at and right is identical to self for all x >= at.

More precisely: contains(left, x) == contains(ranges, x) for x < at contains(right, x) == contains(ranges, x) for x >= at

This is not the same as limiting the ranges to the left or right of at, but it is much faster. It requires just a binary search and no allocations.

source

pub fn boundaries(&self) -> &[T]

The boundaries of the range set, guaranteed to be strictly sorted

source

pub fn contains(&self, value: &T) -> boolwhere T: Ord,

true if the value is contained in the range set

source

pub fn is_empty(&self) -> bool

true if the range set is empty

source

pub fn is_all(&self) -> boolwhere T: RangeSetEntry,

true if the range set contains all values

source

pub fn intersects(&self, that: &RangeSetRef<T>) -> boolwhere T: Ord,

true if this range set intersects from another range set

This is just the opposite of is_disjoint, but is provided for better discoverability.

source

pub fn is_disjoint(&self, that: &RangeSetRef<T>) -> boolwhere T: Ord,

true if this range set is disjoint from another range set

source

pub fn is_subset(&self, that: &RangeSetRef<T>) -> boolwhere T: Ord,

true if this range set is a superset of another range set

A range set is considered to be a superset of itself

source

pub fn is_superset(&self, that: &RangeSetRef<T>) -> boolwhere T: Ord,

true if this range set is a subset of another range set

A range set is considered to be a subset of itself

source

pub fn iter(&self) -> Iter<'_, T>

iterate over all ranges in this range set

source

pub fn intersection<A>(&self, that: &RangeSetRef<T>) -> RangeSet<A>where A: Array<Item = T>, T: Ord + Clone,

intersection

source

pub fn union<A>(&self, that: &RangeSetRef<T>) -> RangeSet<A>where A: Array<Item = T>, T: Ord + Clone,

union

source

pub fn difference<A>(&self, that: &RangeSetRef<T>) -> RangeSet<A>where A: Array<Item = T>, T: Ord + Clone,

difference

source

pub fn symmetric_difference<A>(&self, that: &RangeSetRef<T>) -> RangeSet<A>where A: Array<Item = T>, T: Ord + Clone,

symmetric difference (xor)

Trait Implementations§

source§

impl<T, A> Deref for RangeSet<A>where A: Array<Item = T>,

§

type Target = RangeSetRef<T>

The resulting type after dereferencing.
source§

fn deref(&self) -> &<RangeSet<A> as Deref>::Target

Dereferences the value.