Struct fingertrees::FingerTree

source ·
pub struct FingerTree<R, V>where
    R: Refs<V>,
    V: Measured,
{ /* private fields */ }
Expand description

FingerTree implemenetation

FingerTree is parametrized by two type parpameters

  • R - type family trick which determines type of references used in implementation. This crate implementes ArcRefs which is based on Arc atomic reference counter, and RcRefs which is based on Rc.
  • V - value type which must be measurable and cheaply clonable.

Implementations§

Constructs a new, empty FingerTree

Complexity: O(1)

Returns true if finger tree is empty

Complexity: O(1)

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 left side of the tree, and second element contains tree with reset of the elements

Amortized complexity: O(1)

Destructures tree into two three, using provided predicate.

Predicate must be monotinic function accepting accumulated measure of elments and changing its value from true to false. 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 true to false we stop iteration and form two threes from already iterated elements and the rest of the elements.

Complexity: O(ln(N))

Construct new finger tree wich is concatination of self and other

Complexity: O(ln(N))

Double ended iterator visiting all elements of the tree from left to right

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
The resulting type after applying the + operator.
Performs the + operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Creates a value from an iterator. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
Measure type
Assocated measure with given value
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.