Struct socarel::Node[][src]

pub struct Node<T: NodeContent = RawNode> { /* fields omitted */ }
Expand description

Struct that contains a tree node.

Implementations

Create new root node.

Arguments

  • content - Node content.

Return

  • Node struct or None if content parsing fails.

Create new node.

Arguments

  • content - Node content.
  • level - Node level.

Return

  • Node struct or None if content parsing fails.

Set content.

Arguments

  • content - Node content.

Return

  • Nothing.

Get content. Move self.

Return

  • Node content.

Get content reference.

Return

  • Node content reference.

Set level.

Arguments

  • level - Node level.

Return

  • Nothing.

Get level.

Return

  • Node level.

Get number of children.

Return

  • Number of children.

Set parent node position.

Arguments

  • parent_position - Parent node position.

Return

  • Nothing.

Get parent node position.

Return

  • Parent node position..

Set parent’s children array position.

Arguments

  • parents_children_pos - Position of current node in parent’s children array.

Return

  • Nothing.

Get parent’s children array position.

  • Position of current node in parent’s children array.

Add new child.

Arguments

  • node_content - Node content.
  • node_index - Node index.

Return

  • Nothing.

Remove child.

Arguments

  • node_index - Node index.

Return

  • Nothing.

Update child map.

Arguments

  • node_content - Current node content.
  • new_node_content - New node content.

Return

  • An Option with the node index.

Get child index using node content.

Arguments

  • node_content - Current node content.

Return

  • An Option with the node index.

Get children array reference.

Return

  • Array ref.

Trait Implementations

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.