Struct teardown_tree::IntervalTeardownTreeMap
[−]
[src]
pub struct IntervalTeardownTreeMap<Iv: Interval, V> { /* fields omitted */ }
Methods
impl<Iv: Interval, V> IntervalTeardownTreeMap<Iv, V>
[src]
fn new(items: Vec<(Iv, V)>) -> IntervalTeardownTreeMap<Iv, V>
Creates a new IntervalTeardownTreeMap
with the given set of intervals. The items can be
given in any order. Duplicates are supported.
fn with_sorted(sorted: Vec<(Iv, V)>) -> IntervalTeardownTreeMap<Iv, V>
Creates a new IntervalTeardownTreeMap
with the given set of intervals. Duplicates are
supported.
Note: the items are assumed to be sorted with respect to Interval::cmp()
!
fn find<'a, Q>(&'a self, query: &'a Q) -> Option<&'a V> where Q: Interval<K=Iv::K> + PartialOrd<Iv>
Finds the item with the given key and returns it (or None).
fn contains_key<Q>(&self, query: &Q) -> bool where Q: Interval<K=Iv::K> + PartialOrd<Iv>
Returns true if the map contains the given key.
fn query_overlap<'a, Q, S>(&'a self, query: &Q, sink: S) where Q: Interval<K=Iv::K>, S: Sink<&'a (Iv, V)>
Executes an overlap query.
fn delete<Q>(&mut self, query: &Q) -> Option<V> where Q: PartialEq<Iv> + PartialOrd<Iv>
Deletes the item with the given key from the tree and returns it (or None).
fn delete_overlap<Q, S>(&mut self, query: &Q, sink: S) where Q: Interval<K=Iv::K>, S: Sink<(Iv, V)>
Deletes all intervals that overlap with query
from the tree 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, V)>
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) -> MapIter<'a, Iv, V>
Creates an iterator into the map.
Trait Implementations
impl<Iv: Clone + Interval, V: Clone> Clone for IntervalTeardownTreeMap<Iv, V>
[src]
fn clone(&self) -> IntervalTeardownTreeMap<Iv, V>
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