Struct teardown_tree::TeardownMap
[−]
[src]
pub struct TeardownMap<K: Ord + Clone, V> { /* fields omitted */ }
Methods
impl<K: Ord + Clone, V> TeardownMap<K, V>
[src]
fn new(items: Vec<(K, V)>) -> TeardownMap<K, V>
Creates a new TeardownMap
with the given set of items. The items can be given in
any order. Duplicate keys are supported.
fn with_sorted(sorted: Vec<(K, V)>) -> TeardownMap<K, V>
Creates a new TeardownMap
with the given set of items. Duplicate keys are supported.
Note: the items are assumed to be sorted!
fn find<'a, Q>(&'a self, query: &'a Q) -> Option<&'a V> where
Q: PartialOrd<K>,
Q: PartialOrd<K>,
Finds the item with the given key and returns it (or None).
fn contains_key<Q>(&self, query: &Q) -> bool where
Q: PartialOrd<K>,
Q: PartialOrd<K>,
Returns true if the map contains the given key.
fn query_range<'a, Q, S>(&'a self, range: Range<Q>, sink: S) where
Q: PartialOrd<K>,
S: Sink<&'a (K, V)>,
Q: PartialOrd<K>,
S: Sink<&'a (K, V)>,
Executes a range query.
fn delete<Q>(&mut self, query: &Q) -> Option<V> where
Q: PartialOrd<K>,
Q: PartialOrd<K>,
Deletes the item with the given key from the tree and returns it (or None).
fn delete_range<Q, S>(&mut self, range: Range<Q>, sink: S) where
Q: PartialOrd<K>,
S: Sink<(K, V)>,
Q: PartialOrd<K>,
S: Sink<(K, V)>,
Deletes all items inside range
from the tree and feeds them into sink
.
The items are returned in order.
fn filter_range<Q, Flt, S>(&mut self, range: Range<Q>, filter: Flt, sink: S) where
Q: PartialOrd<K>,
Flt: ItemFilter<K>,
S: Sink<(K, V)>,
Q: PartialOrd<K>,
Flt: ItemFilter<K>,
S: Sink<(K, V)>,
Deletes all items inside range
that match filter
from the tree and feeds them into
sink
. The items are returned in order.
fn delete_range_ref<Q, S>(&mut self, range: Range<&Q>, sink: S) where
Q: PartialOrd<K>,
S: Sink<(K, V)>,
Q: PartialOrd<K>,
S: Sink<(K, V)>,
Deletes all items inside range
from the tree and feeds them into sink
.
fn filter_range_ref<Q, Flt, S>(
&mut self,
range: Range<&Q>,
filter: Flt,
sink: S
) where
Q: PartialOrd<K>,
Flt: ItemFilter<K>,
S: Sink<(K, V)>,
&mut self,
range: Range<&Q>,
filter: Flt,
sink: S
) where
Q: PartialOrd<K>,
Flt: ItemFilter<K>,
S: Sink<(K, V)>,
Deletes all items inside range
that match 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, K, V>
Creates an iterator into the map.
Trait Implementations
impl<K: Clone + Ord + Clone, V: Clone> Clone for TeardownMap<K, V>
[src]
fn clone(&self) -> TeardownMap<K, 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