Struct RootNode

Source
pub struct RootNode {
    pub node: TreeNode,
}
Expand description

The root of a command tree.

Fields§

§node: TreeNode

TreeNode data.

Implementations§

Source§

impl RootNode

Source

pub fn new(successors: Vec<Rc<Node>>) -> Self

Create a new RootNode

Trait Implementations§

Source§

impl NodeOps for RootNode

RootNode does not want to perform any actual NodeOps as these operations should only be invoked by the Parser on successor nodes.

Source§

fn complete<'text>(&self, _token: Option<Token<'text>>) -> Completion<'text>

A RootNode can not be completed.

Source§

fn matches(&self, _parser: &Parser<'_>, _token: Token<'_>) -> bool

A RootNode can not be matched.

Source§

fn accept<'text>( &self, _parser: &mut Parser<'text>, _token: Token<'_>, _node_ref: &Rc<Node>, )

Accept this node with the given token as data. Read more
Source§

fn acceptable(&self, _parser: &Parser<'_>, _node_ref: &Rc<Node>) -> bool

Can this node be accepted in the current parser state? By default, a node can be accepted when it hasn’t been seen yet. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.