Struct tree_cursor::cursor::TreeCursorMut[][src]

pub struct TreeCursorMut<'n: 'f, 'f, N: 'n> { /* fields omitted */ }

A cursor that holds a mutable reference to its tree.

Methods

impl<'n, N: 'n> TreeCursorMut<'n, 'n, N>
[src]

Creates a new TreeCursorMut starting at root.

impl<'n: 'f, 'f, N: 'n> TreeCursorMut<'n, 'f, N>
[src]

Passes f the active node and the current value of the "next child" counter. If f returns a node, it's set as the active node, the old active node's "next child" counter is incremented, and this method returns true. Otherwise, this method returns false.

Like down_new, except that it takes a closure like down_map.

Resets the active node's "next child" counter to 0.

Moves the cursor up one node. Returns true if there was a node to move to, and false otherwise. In both cases, the old active node's "next child" counter is reset, as if zero had been called.

Takes the active node from this TreeCursorMut and returns a new TreeCursorMut at that position. self is frozen until the new cursor goes out of scope.

Returns a shared reference to the active node.

Returns a mutable reference to the active node.

impl<'n: 'f, 'f, N: 'n + DownMut> TreeCursorMut<'n, 'f, N>
[src]

Returns an opaque object that stores the current position of the cursor. Pass it to set_pos to restore that position.

Moves the cursor to the given position, as long as tree mutation hasn't invalidated the position since it was retrieved.

Panics

If the tree has changed such that the position is no longer valid, this method panics. However, since the position is stored using "next child" indices (not pointers), it remains valid as long as the tree has a node in that position, even if the node's value changes or it's replaced with another node. If this is a problem, you should track the position's validity yourself.

Moves the cursor down one node. The node to move to is determined by calling DownMut::down_mut on the active node and passing it the "next child" counter. Returns true and increments the old active node's "next child" counter if there was a node to move to, and returns false otherwise.

Like down, except instead of moving the position of self, it returns a new TreeCursorMut whose root is the new position. self is frozen until the new cursor goes out of scope.

Trait Implementations

impl<'n: 'f, 'f, N: 'n> From<TreeCursorMut<'n, 'f, N>> for TreeCursor<'n, 'f, N>
[src]

Performs the conversion.

impl<'n: 'f, 'f, N: Debug + 'n> Debug for TreeCursorMut<'n, 'f, N>
[src]

Formats the value using the given formatter. Read more

impl<'n: 'f, 'f, N: Eq + 'n> Eq for TreeCursorMut<'n, 'f, N>
[src]

impl<'n: 'f, 'f, N: Hash + 'n> Hash for TreeCursorMut<'n, 'f, N>
[src]

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

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

impl<'n: 'f, 'f, N: PartialEq + 'n> PartialEq for TreeCursorMut<'n, 'f, N>
[src]

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

This method tests for !=.

Auto Trait Implementations

impl<'n, 'f, N> !Send for TreeCursorMut<'n, 'f, N>

impl<'n, 'f, N> !Sync for TreeCursorMut<'n, 'f, N>