Struct teardown_tree::IntervalTeardownSet
[−]
[src]
pub struct IntervalTeardownSet<Iv: Interval> { /* fields omitted */ }
Methods
impl<Iv: Interval> IntervalTeardownSet<Iv>
[src]
fn new(items: Vec<Iv>) -> IntervalTeardownSet<Iv>
Creates a new IntervalTeardownSet
with the given set of intervals. The items can be
given in any order. Duplicates are supported.
fn with_sorted(sorted: Vec<Iv>) -> IntervalTeardownSet<Iv>
Creates a new IntervalTeardownSet
with the given set of intervals. Duplicates are
supported.
Note: the items are assumed to be sorted!
fn contains<Q>(&self, query: &Q) -> bool where
Q: Interval<K = Iv::K> + PartialOrd<Iv>,
Q: Interval<K = Iv::K> + PartialOrd<Iv>,
Returns true if the set contains the given item.
fn query_overlap<'a, Q, S>(&'a self, query: &Q, sink: S) where
Q: Interval<K = Iv::K>,
S: Sink<&'a Iv>,
Q: Interval<K = Iv::K>,
S: Sink<&'a Iv>,
Executes an overlap query.
fn delete<Q>(&mut self, query: &Q) -> bool where
Q: Interval<K = Iv::K> + PartialOrd<Iv>,
Q: Interval<K = Iv::K> + PartialOrd<Iv>,
Deletes the given interval from the tree and returns true (or false if it was not found).
fn delete_overlap<Q, S>(&mut self, query: &Q, sink: S) where
Q: Interval<K = Iv::K>,
S: Sink<Iv>,
Q: Interval<K = Iv::K>,
S: Sink<Iv>,
Deletes all intervals that overlap with query
from the tree and and feeds them into
sink
. The items are returned in order.
fn filter_overlap<Q, Flt, S>(&mut self, query: &Q, f: Flt, sink: S) where
Q: Interval<K = Iv::K>,
Flt: ItemFilter<Iv>,
S: Sink<Iv>,
Q: Interval<K = Iv::K>,
Flt: ItemFilter<Iv>,
S: Sink<Iv>,
Deletes all intervals that overlap with query
and match the filter from the tree and
feeds them into sink
. The items are returned in order.
fn size(&self) -> usize
Returns the number of items in this tree.
fn is_empty(&self) -> bool
fn clear(&mut self)
Removes all items from the tree (the items are dropped, but the internal storage is not).
fn iter<'a>(&'a self) -> IntervalSetIter<'a, Iv>
Creates an iterator into the set.
Trait Implementations
impl<Iv: Clone + Interval> Clone for IntervalTeardownSet<Iv>
[src]
fn clone(&self) -> IntervalTeardownSet<Iv>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<Iv: Interval + Copy> Refill for IntervalTeardownSet<Iv>
[src]
fn refill(&mut self, master: &Self)
impl<Iv: Interval + Debug> Debug for IntervalTeardownSet<Iv> where
Iv::K: Debug,
[src]
Iv::K: Debug,
impl<Iv: Interval> Display for IntervalTeardownSet<Iv> where
Iv::K: Debug,
[src]
Iv::K: Debug,