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