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]
impl<K: Ord, V> IntervalTree<K, V>
ⓘImportant traits for QueryIter<'a, K, V>pub fn query(&self, range: Range<K>) -> QueryIter<K, V>
[src]
pub fn query(&self, range: Range<K>) -> QueryIter<K, V>
Queries the interval tree for all elements overlapping a given interval.
This runs in O(log n + m)
.
ⓘImportant traits for QueryIter<'a, K, V>pub fn query_point(&self, point: K) -> QueryIter<K, V>
[src]
pub fn query_point(&self, point: K) -> QueryIter<K, V>
Queries the interval tree for all elements containing a given point.
This runs in O(log n + m)
.
ⓘImportant traits for TreeIter<'a, K, V>pub fn iter(&self) -> TreeIter<K, V>
[src]
pub fn iter(&self) -> TreeIter<K, V>
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]
impl<K: Clone, V: Clone> Clone for IntervalTree<K, V>
fn clone(&self) -> IntervalTree<K, V>
[src]
fn clone(&self) -> IntervalTree<K, V>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<K: Debug, V: Debug> Debug for IntervalTree<K, V>
[src]
impl<K: Debug, V: Debug> Debug for IntervalTree<K, V>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<K: Hash, V: Hash> Hash for IntervalTree<K, V>
[src]
impl<K: Hash, V: Hash> Hash for IntervalTree<K, V>
fn hash<__HKV: Hasher>(&self, state: &mut __HKV)
[src]
fn hash<__HKV: Hasher>(&self, state: &mut __HKV)
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
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]
impl<K: Ord + Clone, V, I: Into<Element<K, V>>> FromIterator<I> for IntervalTree<K, V>
fn from_iter<T: IntoIterator<Item = I>>(iter: T) -> Self
[src]
fn from_iter<T: IntoIterator<Item = I>>(iter: T) -> Self
Creates a value from an iterator. Read more
impl<'a, K: 'a + Ord, V: 'a> IntoIterator for &'a IntervalTree<K, V>
[src]
impl<'a, K: 'a + Ord, V: 'a> IntoIterator for &'a IntervalTree<K, V>
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?
ⓘImportant traits for TreeIter<'a, K, V>fn into_iter(self) -> TreeIter<'a, K, V>
[src]
fn into_iter(self) -> TreeIter<'a, K, V>
Creates an iterator from a value. Read more
impl<K, V> IntoIterator for IntervalTree<K, V>
[src]
impl<K, V> IntoIterator for IntervalTree<K, V>
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?
ⓘImportant traits for TreeIntoIter<K, V>fn into_iter(self) -> TreeIntoIter<K, V>
[src]
fn into_iter(self) -> TreeIntoIter<K, V>
Creates an iterator from a value. Read more
Auto Trait Implementations
impl<K, V> Send for IntervalTree<K, V> where
K: Send,
V: Send,
impl<K, V> Send for IntervalTree<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for IntervalTree<K, V> where
K: Sync,
V: Sync,
impl<K, V> Sync for IntervalTree<K, V> where
K: Sync,
V: Sync,