Struct iodyn::tree_cursor::Cursor [] [src]

pub struct Cursor<E: TreeUpdate + Debug + Clone + Eq + Hash + 'static> { /* fields omitted */ }

tree cursor, centered on a node of the underlying persistent tree

A cursor allows exploration of the underlying tree by following links to branches or up towards root. This structure is optimised for splitting and combining trees in a cannonical way based on the levels of the nodes; that is, trees with the same levels will have the same structure, regaurdless of order of operations.

Many operations allow structural mutation of the underlying tree.

Methods

impl<'a, E: TreeUpdate + Debug + Clone + Eq + Hash + 'static> Cursor<E>
[src]

creates a new cursor, to an empty underlying tree

creates a new cursor, with expected depth of underlying tree

Returns the node the cursor is focused on as a tree, plus two cursors containing every node to the left and right, focused on at the two branches of the returned tree

A specialized split that returns iterators

Converts the cursor into two iterators, over elements to the left and right of the cursor. The tree at the cursor is returned as well. The iterators include data it its branches, but not the tree's data. Data in a tree is considered to be between the data of the left and right branches.

makes a new cursor at the given data, between the trees of the other cursors

The rebuild() method of the data type will be called, with the data parameter passed here as the old_data to that method (along with joined branches).

copies the focused node as a tree

This is a persistent tree, so copies are Rc clones

copies the left branch of the focused node

copies the right branch of the focused node

peek at the data of the focused tree node

peek at the level of the focused tree node

peek at the name of the focused tree node if there is a focused tree and it has a name

move the cursor into the left branch, returning true if successful use the Force enum to determine the type of movement

move the cursor to the left branch, without entering an empty branch

move the cursor into the right branch, returning true if successful use the Force enum to determine the type of movement

move the cursor to the right branch, without entering an empty branch

move the cursor up towards the root of the underlying persistent tree

If the tree has been changed, the rebuild() method of the tree's data type will be called as a new persistent node is created. The return value represents the direction the cursor moved

move the cursor up, discarding any changes

The return value represents the direction the cursor moved

Trait Implementations

impl<E: Debug + TreeUpdate + Debug + Clone + Eq + Hash + 'static> Debug for Cursor<E>
[src]

Formats the value using the given formatter.

impl<E: PartialEq + TreeUpdate + Debug + Clone + Eq + Hash + 'static> PartialEq for Cursor<E>
[src]

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

This method tests for !=.

impl<E: Eq + TreeUpdate + Debug + Clone + Eq + Hash + 'static> Eq for Cursor<E>
[src]

impl<E: Hash + TreeUpdate + Debug + Clone + Eq + Hash + 'static> Hash for Cursor<E>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<E: TreeUpdate + Debug + Clone + Eq + Hash + 'static> Clone for Cursor<E>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<E: TreeUpdate + Debug + Clone + Eq + Hash + 'static> From<Tree<E>> for Cursor<E>
[src]

Performs the conversion.