Struct fingertrees::FingerTree [−][src]
Expand description
FingerTree implemenetation
FingerTree is parametrized by two type parpameters
Implementations
Creates new tree with value prepended to the left side of the tree
Amortized complexity: O(1)
Creates new tree with value prepended to the right side of the tree
Amortized complexity: O(1)
Destrutures tree into a tuple with first element of it containing first element from the left side of the tree, and second element contains tree with reset of the elements
Amortized complexity: O(1)
Destrutures tree into a tuple with first element of it containing first element from the right side of the tree, and second element contains tree with reset of the elements
Amortized complexity: O(1)
pub fn split<F>(&self, pred: F) -> (FingerTree<R, V>, FingerTree<R, V>) where
F: FnMut(&V::Measure) -> bool,
pub fn split<F>(&self, pred: F) -> (FingerTree<R, V>, FingerTree<R, V>) where
F: FnMut(&V::Measure) -> bool,
Destructures tree into two three, using provided predicate.
Predicate must be monotinic function accepting accumulated measure of elements
and changing its value from false to true. This function basically behave
as if we would iterate all elements from left to right, and accumlating measure
of all iterated elements, calling predicate on this accumulated value and once
its value flips from false to true we stop iteration and form two trees
from already iterated elements and the rest of the elements.
Complexity: O(ln(N))
partial logic from .split(...) with only left part returned
partial logic from .split(...) with only right part returned
Find element for which predicate function pred flips from false to true
Construct new finger tree wich is concatination of self and other
Complexity: O(ln(N))
Trait Implementations
impl<'a, 'b, R, V> Add<&'b FingerTree<R, V>> for &'a FingerTree<R, V> where
R: Refs<V>,
V: Measured,
impl<'a, 'b, R, V> Add<&'b FingerTree<R, V>> for &'a FingerTree<R, V> where
R: Refs<V>,
V: Measured,
type Output = FingerTree<R, V>
type Output = FingerTree<R, V>
The resulting type after applying the + operator.
Performs the + operation. Read more
Creates a value from an iterator. Read more
impl<R, V> PartialEq<FingerTree<R, V>> for FingerTree<R, V> where
R: Refs<V>,
V: Measured + PartialEq,
impl<R, V> PartialEq<FingerTree<R, V>> for FingerTree<R, V> where
R: Refs<V>,
V: Measured + PartialEq,
Auto Trait Implementations
impl<R, V> RefUnwindSafe for FingerTree<R, V> where
<R as Refs<V>>::Node: RefUnwindSafe,
<R as Refs<V>>::Tree: RefUnwindSafe,
impl<R, V> Unpin for FingerTree<R, V> where
<R as Refs<V>>::Node: Unpin,
<R as Refs<V>>::Tree: Unpin,
impl<R, V> UnwindSafe for FingerTree<R, V> where
<R as Refs<V>>::Node: UnwindSafe,
<R as Refs<V>>::Tree: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more