Struct intervaltree::IntervalTree
[−]
[src]
pub struct IntervalTree<K, V> { /* fields omitted */ }
A simple and generic implementation of an immutable interval tree.
To build it, always use FromIterator
. This is not very optimized
as it takes O(log n)
stack (it uses recursion) but runs in O(n log n)
.
Methods
impl<K: Ord, V> IntervalTree<K, V>
[src]
fn query(&self, range: Range<K>) -> QueryIter<K, V>
[src]
Queries the interval tree for all elements overlapping a given interval.
This runs in O(log n + m)
.
fn query_point(&self, point: K) -> QueryIter<K, V>
[src]
Queries the interval tree for all elements containing a given point.
This runs in O(log n + m)
.
fn iter(&self) -> TreeIter<K, V>
[src]
Returns an iterator over all elements in the tree (in no particular order).
Trait Implementations
impl<K: Clone, V: Clone> Clone for IntervalTree<K, V>
[src]
fn clone(&self) -> IntervalTree<K, V>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<K: Debug, V: Debug> Debug for IntervalTree<K, V>
[src]
impl<K: Hash, V: Hash> Hash for IntervalTree<K, V>
[src]
fn hash<__HKV: Hasher>(&self, __arg_0: &mut __HKV)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<K: Ord + Clone, V, I: Into<Element<K, V>>> FromIterator<I> for IntervalTree<K, V>
[src]
fn from_iter<T: IntoIterator<Item = I>>(iter: T) -> Self
[src]
Creates a value from an iterator. Read more
impl<'a, K: 'a + Ord, V: 'a> IntoIterator for &'a IntervalTree<K, V>
[src]
type Item = &'a Element<K, V>
The type of the elements being iterated over.
type IntoIter = TreeIter<'a, K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> TreeIter<'a, K, V>
[src]
Creates an iterator from a value. Read more
impl<K, V> IntoIterator for IntervalTree<K, V>
[src]
type Item = Element<K, V>
The type of the elements being iterated over.
type IntoIter = TreeIntoIter<K, V>
Which kind of iterator are we turning this into?
fn into_iter(self) -> TreeIntoIter<K, V>
[src]
Creates an iterator from a value. Read more