Struct teardown_tree::IntervalTeardownMap
[−]
[src]
pub struct IntervalTeardownMap<Iv: Interval, V> { /* fields omitted */ }
Methods
impl<Iv: Interval, V> IntervalTeardownMap<Iv, V>
[src]
fn new(items: Vec<(Iv, V)>) -> IntervalTeardownMap<Iv, V>
Creates a new IntervalTeardownMap
with the given set of intervals. The items can be
given in any order. Duplicates are supported.
fn with_sorted(sorted: Vec<(Iv, V)>) -> IntervalTeardownMap<Iv, V>
Creates a new IntervalTeardownMap
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>,
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>,
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)>,
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>,
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)>,
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)>,
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) -> IntervalMapIter<'a, Iv, V>
Creates an iterator into the map.
Trait Implementations
impl<Iv: Clone + Interval, V: Clone> Clone for IntervalTeardownMap<Iv, V>
[src]
fn clone(&self) -> IntervalTeardownMap<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
impl<Iv: Interval + Copy, V: Copy> Refill for IntervalTeardownMap<Iv, V>
[src]
fn refill(&mut self, master: &Self)
impl<Iv: Interval + Debug, V> Debug for IntervalTeardownMap<Iv, V> where
Iv::K: Debug,
[src]
Iv::K: Debug,
impl<Iv: Interval, V> Display for IntervalTeardownMap<Iv, V> where
Iv::K: Debug,
[src]
Iv::K: Debug,