Struct rctree::Node [] [src]

pub struct Node<T>(_);

A reference to a node holding a value of type T. Nodes form a tree.

Internally, this uses reference counting for lifetime tracking and std::cell::RefCell for interior mutability.

Note: Cloning a Node only increments a reference count. It does not copy the data.

Methods

impl<T> Node<T>
[src]

[src]

Creates a new node from its associated data.

[src]

Returns a root node.

If the current node is the root node - will return itself.

Panics

Panics if the node is currently mutability borrowed.

[src]

Returns a parent node, unless this node is the root of the tree.

Panics

Panics if the node is currently mutability borrowed.

[src]

Returns a first child of this node, unless it has no child.

Panics

Panics if the node is currently mutability borrowed.

[src]

Returns a last child of this node, unless it has no child.

Panics

Panics if the node is currently mutability borrowed.

[src]

Returns a previous sibling of this node, unless it is a first child.

Panics

Panics if the node is currently mutability borrowed.

[src]

Returns a previous sibling of this node, unless it is a first child.

Panics

Panics if the node is currently mutability borrowed.

[src]

Returns a shared reference to this node's data

Panics

Panics if the node is currently mutability borrowed.

[src]

Returns a unique/mutable reference to this node's data

Panics

Panics if the node is currently borrowed.

Important traits for Ancestors<T>
[src]

Returns an iterator of nodes to this node and its ancestors.

Includes the current node.

Important traits for PrecedingSiblings<T>
[src]

Returns an iterator of nodes to this node and the siblings before it.

Includes the current node.

Important traits for FollowingSiblings<T>
[src]

Returns an iterator of nodes to this node and the siblings after it.

Includes the current node.

Important traits for Children<T>
[src]

Returns an iterator of nodes to this node's children.

Panics

Panics if the node is currently mutability borrowed.

[src]

Returns true if this node has children nodes.

Panics

Panics if the node is currently mutability borrowed.

Important traits for ReverseChildren<T>
[src]

Returns an iterator of nodes to this node's children, in reverse order.

Panics

Panics if the node is currently mutability borrowed.

Important traits for Descendants<T>
[src]

Returns an iterator of nodes to this node and its descendants, in tree order.

Includes the current node.

Important traits for Traverse<T>
[src]

Returns an iterator of nodes to this node and its descendants, in tree order.

Important traits for ReverseTraverse<T>
[src]

Returns an iterator of nodes to this node and its descendants, in tree order.

[src]

Detaches a node from its parent and siblings. Children are not affected.

Panics

Panics if the node or one of its adjoining nodes is currently borrowed.

[src]

Appends a new child to this node, after existing children.

Panics

Panics if the node, the new child, or one of their adjoining nodes is currently borrowed.

[src]

Prepends a new child to this node, before existing children.

Panics

Panics if the node, the new child, or one of their adjoining nodes is currently borrowed.

[src]

Inserts a new sibling after this node.

Panics

Panics if the node, the new sibling, or one of their adjoining nodes is currently borrowed.

[src]

Inserts a new sibling before this node.

Panics

Panics if the node, the new sibling, or one of their adjoining nodes is currently borrowed.

[src]

Returns a copy of a current node without children.

Panics

Panics if the node is currently mutably borrowed.

[src]

Returns a copy of a current node with children.

Panics

Panics if any of the descendant nodes are currently mutability borrowed.

Trait Implementations

impl<T> Clone for Node<T>
[src]

Cloning a Node only increments a reference count. It does not copy the data.

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> PartialEq for Node<T>
[src]

[src]

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

1.0.0
[src]

This method tests for !=.

impl<T: Debug> Debug for Node<T>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> !Send for Node<T>

impl<T> !Sync for Node<T>