[−][src]Trait xi_rope::tree::NodeInfo
Associated Types
type L: Leaf
The type of the leaf.
A given NodeInfo
is for exactly one type of leaf. That is why
the leaf type is an associated type rather than a type parameter.
Required methods
fn accumulate(&mut self, other: &Self)
An operator that combines info from two subtrees. It is intended (but not strictly enforced) that this operator be associative and obey an identity property. In mathematical terms, the accumulate method is the operation of a monoid.
fn compute_info(_: &Self::L) -> Self
A mapping from a leaf into the info type. It is intended (but not strictly enforced) that applying the accumulate method to the info derived from two leaves gives the same result as deriving the info from the concatenation of the two leaves. In mathematical terms, the compute_info method is a monoid homomorphism.
Provided methods
fn identity() -> Self
The identity of the monoid. Need not be implemented because it can be computed from the leaf default.
This is here to demonstrate that this is a monoid.
fn interval(&self, len: usize) -> Interval
The interval covered by the first len
base units of this node. The
default impl is sufficient for most types, but interval trees may need
to override it.