Struct xi_rope::tree::Node
[−]
[src]
pub struct Node<N: NodeInfo>(_);
A b-tree node storing leaves at the bottom, and with info retained at each node. It is implemented with atomic reference counting and copy-on-write semantics, so an immutable clone is a very cheap operation, and nodes can be shared across threads. Even so, it is designed to be updated in place, with efficiency similar to a mutable data structure, using uniqueness of reference count to detect when this operation is safe.
When the leaf is a string, this is a rope data structure (a persistent rope in functional programming jargon). However, it is not restricted to strings, and it is expected to be the basis for a number of data structures useful for text processing.
Methods
impl<N: NodeInfo> Node<N>
[src]
fn from_leaf(l: N::L) -> Node<N>
fn len(&self) -> usize
fn concat(rope1: Node<N>, rope2: Node<N>) -> Node<N>
fn measure<M: Metric<N>>(&self) -> usize
fn push_subseq(&self, b: &mut TreeBuilder<N>, iv: Interval)
fn subseq(&self, iv: Interval) -> Node<N>
fn edit(&mut self, iv: Interval, new: Node<N>)
fn convert_metrics<M1: Metric<N>, M2: Metric<N>>(&self, m1: usize) -> usize
Trait Implementations
impl<N: Clone + NodeInfo> Clone for Node<N>
[src]
fn clone(&self) -> Node<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more