Struct fingertrees::FingerTree[][src]

pub struct FingerTree<R, V> where
    R: Refs<V>,
    V: Measured
{ /* fields omitted */ }
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 right 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 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))

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 !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.