Struct tree_cursor::cursor::TreeCursor [−][src]
pub struct TreeCursor<'n: 'f, 'f, N: 'n> { /* fields omitted */ }
A cursor that holds a shared reference to its tree.
Methods
impl<'n, N: 'n> TreeCursor<'n, 'n, N>
[src]
impl<'n, N: 'n> TreeCursor<'n, 'n, N>
impl<'n: 'f, 'f, N: 'n> TreeCursor<'n, 'f, N>
[src]
impl<'n: 'f, 'f, N: 'n> TreeCursor<'n, 'f, N>
pub fn down_map<F>(&mut self, f: F) -> bool where
F: Fn(&'n N, usize) -> Option<&'n N>,
[src]
pub fn down_map<F>(&mut self, f: F) -> bool where
F: Fn(&'n N, usize) -> Option<&'n N>,
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.
pub fn down_map_new<'s, F>(&'s mut self, f: F) -> Option<TreeCursor<'n, 's, N>> where
F: Fn(&'n N, usize) -> Option<&'n N>,
[src]
pub fn down_map_new<'s, F>(&'s mut self, f: F) -> Option<TreeCursor<'n, 's, N>> where
F: Fn(&'n N, usize) -> Option<&'n N>,
pub fn zero(&mut self)
[src]
pub fn zero(&mut self)
Resets the active node's "next child" counter to 0.
pub fn up(&mut self) -> bool
[src]
pub fn up(&mut self) -> bool
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.
pub fn take<'s>(&'s mut self) -> Option<TreeCursor<'n, 's, N>>
[src]
pub fn take<'s>(&'s mut self) -> Option<TreeCursor<'n, 's, N>>
Takes the active node from this TreeCursor
and returns a new
TreeCursor
at that position. self
is frozen until the new cursor
goes out of scope.
pub fn get(&self) -> &N
[src]
pub fn get(&self) -> &N
Returns a shared reference to the active node.
impl<'n: 'f, 'f, N: 'n + Down> TreeCursor<'n, 'f, N>
[src]
impl<'n: 'f, 'f, N: 'n + Down> TreeCursor<'n, 'f, N>
pub fn down(&mut self) -> bool
[src]
pub fn down(&mut self) -> bool
Moves the cursor down one node. The node to move to is determined by
calling Down::down
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.
pub fn down_new<'s>(&'s mut self) -> Option<TreeCursor<'n, 's, N>>
[src]
pub fn down_new<'s>(&'s mut self) -> Option<TreeCursor<'n, 's, N>>
Like down
, except instead of moving the position of self
, it
returns a new TreeCursor
whose root is the new position. self
is
frozen until the new cursor goes out of scope.
Trait Implementations
impl<'n: 'f, 'f, N: Clone + 'n> Clone for TreeCursor<'n, 'f, N>
[src]
impl<'n: 'f, 'f, N: Clone + 'n> Clone for TreeCursor<'n, 'f, N>
fn clone(&self) -> TreeCursor<'n, 'f, N>
[src]
fn clone(&self) -> TreeCursor<'n, 'f, N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<'n: 'f, 'f, N: Debug + 'n> Debug for TreeCursor<'n, 'f, N>
[src]
impl<'n: 'f, 'f, N: Debug + 'n> Debug for TreeCursor<'n, 'f, N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'n: 'f, 'f, N: Eq + 'n> Eq for TreeCursor<'n, 'f, N>
[src]
impl<'n: 'f, 'f, N: Eq + 'n> Eq for TreeCursor<'n, 'f, N>
impl<'n: 'f, 'f, N: Hash + 'n> Hash for TreeCursor<'n, 'f, N>
[src]
impl<'n: 'f, 'f, N: Hash + 'n> Hash for TreeCursor<'n, 'f, N>
fn hash<__HN: Hasher>(&self, state: &mut __HN)
[src]
fn hash<__HN: Hasher>(&self, state: &mut __HN)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'n: 'f, 'f, N: PartialEq + 'n> PartialEq for TreeCursor<'n, 'f, N>
[src]
impl<'n: 'f, 'f, N: PartialEq + 'n> PartialEq for TreeCursor<'n, 'f, N>
fn eq(&self, other: &TreeCursor<'n, 'f, N>) -> bool
[src]
fn eq(&self, other: &TreeCursor<'n, 'f, N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &TreeCursor<'n, 'f, N>) -> bool
[src]
fn ne(&self, other: &TreeCursor<'n, 'f, N>) -> bool
This method tests for !=
.
impl<'n: 'f, 'f, N: 'n> From<TreeCursorMut<'n, 'f, N>> for TreeCursor<'n, 'f, N>
[src]
impl<'n: 'f, 'f, N: 'n> From<TreeCursorMut<'n, 'f, N>> for TreeCursor<'n, 'f, N>
fn from(cm: TreeCursorMut<'n, 'f, N>) -> Self
[src]
fn from(cm: TreeCursorMut<'n, 'f, N>) -> Self
Performs the conversion.
Auto Trait Implementations
impl<'n, 'f, N> !Send for TreeCursor<'n, 'f, N>
impl<'n, 'f, N> !Send for TreeCursor<'n, 'f, N>
impl<'n, 'f, N> !Sync for TreeCursor<'n, 'f, N>
impl<'n, 'f, N> !Sync for TreeCursor<'n, 'f, N>