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
root: Location<T, M>
The location on the stash that constitutes the root for this collection.
stash: Stash<T, M>
The store for values of type Node
divisor: usize
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]
T: Val,
M: Meta<T>,
fn new() -> Self
Returns a new, empty Collection.
fn new_from(root: Location<T, M>, stash: Stash<T, M>) -> Self
Constructs a Collection given a root and a stash
fn _html(&self) -> String where
T: Debug,
T: Debug,
Produces a html representation of this Collection. For debug use only.
fn clone_mut(&mut self) -> Self
Clones the collection, mutating self
fn union_using<F, E>(&mut self, b: &mut Self) -> Self where
F: Meta<T> + Select<T> + PartialEq + Ord,
E: Meta<T> + PartialEq,
M: SubMeta<F> + SubMeta<E>,
F: Meta<T> + Select<T> + PartialEq + Ord,
E: Meta<T> + PartialEq,
M: SubMeta<F> + SubMeta<E>,
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
.
fn mut_context<R: Relative>(
&mut self,
branch: Branch<T, M, R>
) -> MutContext<T, M, R>
&mut self,
branch: Branch<T, M, R>
) -> MutContext<T, M, R>
Constructs a MutContext context, given a branch into the Collection.
impl<T, M> Collection<T, M> where
T: Val,
M: Meta<T>,
[src]
T: Val,
M: Meta<T>,
fn iter<'a>(&'a self) -> Iter<'a, T, M, Beginning>
Returns an iterator over Collection
fn iter_rev<'a>(&'a self) -> Iter<'a, T, M, End>
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]
T: Val,
M: Meta<T> + SubMeta<CheckSum<u64>>,