Struct collection::Collection [] [src]

pub struct Collection<T, M> where T: Val, M: Meta<T> {
    pub root: Location<T, M>,
    pub stash: Stash<T, M>,
    pub divisor: usize,
}

A collection of elements of type T, with metadata of type M.

This is the base type, that all the collection operations are implemented over.

Fields

The location on the stash that constitutes the root for this collection.

The store for values of type Node

The branching factor, currently hard-coded to 2, which means on average every fourth element will have weight > 0.

Methods

impl<T, M> Collection<T, M> where T: Val, M: Meta<T>
[src]

Returns a new, empty Collection.

Constructs a Collection given a root and a stash

Produces a html representation of this Collection. For debug use only.

Clones the collection, mutating self

Returns a new, cloned collection that is the result of a union operation given two Meta implementations F and E

F is used to select which T goes first in the union.

E is used to find overlapping common subtrees.

For Sets: F: Max<T>, E: CheckSum<T>, and for Maps: F: Key<T::Key>, E: KeySum<T>.

When the equality testing succeeds, elements will be picked from the Collection b.

Constructs a MutContext context, given a branch into the Collection.

impl<T, M> Collection<T, M> where T: Val, M: Meta<T>
[src]

Returns an iterator over Collection

Returns a reverse iterator over Collection

Trait Implementations

impl<T, M> PartialEq for Collection<T, M> where T: Val, M: Meta<T> + SubMeta<CheckSum<u64>>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T, M> SetOps<T> for Collection<T, M> where T: Val + Ord, M: Meta<T> + SubMeta<Max<T>>
[src]

Is element a member of this set?

Insert element into set

Remove element from set

impl<T, M> SetOpsCheckSum<T> for Collection<T, M> where T: Val + Ord + Hash,
        M: Meta<T> + SubMeta<Max<T>> + SubMeta<CheckSum<u64>>
[src]

Return a new Collection, that is the union of self and b

impl<T, M> VectorOps<T, M> for Collection<T, M> where T: Val, M: Meta<T> + SubMeta<Cardinality<usize>>
[src]

Get a reference to element at index i

Get a mutable reference to element at index i

Insert element at index i

Remove element from index i

Push element to end of vector

Pop from the end of the vector

Split the vector in two at index i

Concatenate two vectors

Splice in a vector at index i

impl<K, V, M> MapOps<K, V, M> for Collection<KV<K, V>, M> where M: Meta<KV<K, V>> + SubMeta<Key<K>>, K: Val + Ord, V: Clone
[src]

Insert a value V at key K

Remove value at key K

Get a reference to the value at key K

Get a mutable reference to the value at key K

impl<K, V, M> MapOpsKeySum<K, V, M> for Collection<KV<K, V>, M> where M: Meta<KV<K, V>> + SubMeta<Key<K>> + SubMeta<KeySum<u64>>,
        K: Val + Ord + Hash,
        V: Clone
[src]

Merge two maps, overwriting values from self with b