Struct inlined_parser::Node
[−]
[src]
pub struct Node<'a> { pub name: &'static str, pub start: usize, pub end: usize, pub contents: NodeContents<'a>, }
Fields
name: &'static str
The name of the node.
start: usize
The (inclusive) start index of the range this node matches. It's the byte (NOT char) offset of the parse input.
end: usize
The (exclusive) end index of the range this node matches. It's the byte (NOT char) offset of the parse input.
contents: NodeContents<'a>
The contents of the node; this can be either children nodes or a matched
&[u8]
slice.
Methods
impl<'a> Node<'a>
[src]
fn displayName(&self) -> &'static str
The node name if set, or "
fn withoutName(start: usize, end: usize, contents: NodeContents<'a>) -> Node<'a>
Creates a Node
with an empty name.
fn withChildren(name: &'static str, children: Vec<Node<'a>>) -> Node<'a>
Creates a Node
with the provided name
and makes it a parent of the
provided children
.
fn preOrder<'b>(&'b self) -> PreOrderNodes<'b, 'a>
Traverses the tree rooted at the node with pre-order traversal. Includes
the self
node as the first node.
fn matchedData(&self) -> Vec<u8>
Concatenates and returns all &[u8]
data in the leaf nodes beneath
the current node.
Trait Implementations
impl<'a> PartialEq for Node<'a>
[src]
fn eq(&self, __arg_0: &Node<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Node<'a>) -> bool
This method tests for !=
.