[go: up one dir, main page]

Struct comrak::arena_tree::Node[][src]

pub struct Node<'a, T: 'a> {
    pub data: T,
    // some fields omitted
}
Expand description

A node inside a DOM-like tree.

Fields

data: T

The data held by the node.

Implementations

Create a new node from its associated data.

Typically, this node needs to be moved into an arena allocator before it can be used in a tree.

Return a reference to the parent node, unless this node is the root of the tree.

Return a reference to the first child of this node, unless it has no child.

Return a reference to the last child of this node, unless it has no child.

Return a reference to the previous sibling of this node, unless it is a first child.

Return a reference to the previous sibling of this node, unless it is a last child.

Returns whether two references point to the same node.

Return an iterator of references to this node and its ancestors.

Call .next().unwrap() once on the iterator to skip the node itself.

Return an iterator of references to this node and the siblings before it.

Call .next().unwrap() once on the iterator to skip the node itself.

Return an iterator of references to this node and the siblings after it.

Call .next().unwrap() once on the iterator to skip the node itself.

Return an iterator of references to this node’s children.

Return an iterator of references to this node’s children, in reverse order.

Return an iterator of references to this node and its descendants, in tree order.

Parent nodes appear before the descendants. Call .next().unwrap() once on the iterator to skip the node itself.

Return an iterator of references to this node and its descendants, in tree order.

Return an iterator of references to this node and its descendants, in tree order.

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

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

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

Insert a new sibling after this node.

Insert a new sibling before this node.

Trait Implementations

A simple Debug implementation that prints the children as a tree, without ilooping through the various interior pointer cycles.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.