Struct commands::parser::ParameterNode
[−]
[src]
pub struct ParameterNode { pub node: TreeNode, pub required: bool, pub kind: ParameterKind, }
A node representing a parameter for a command.
Fields
node: TreeNode
TreeNode
data.
required: bool
A required
parameter must be supplied for the
command line being parsed to be valid.
kind: ParameterKind
What type of ParameterKind
this is.
Methods
impl ParameterNode
[src]
fn new(
name: &str,
help_text: Option<&str>,
hidden: bool,
priority: i32,
successors: Vec<Rc<Node>>,
repeatable: bool,
repeat_marker: Option<Rc<Node>>,
kind: ParameterKind,
required: bool
) -> Self
name: &str,
help_text: Option<&str>,
hidden: bool,
priority: i32,
successors: Vec<Rc<Node>>,
repeatable: bool,
repeat_marker: Option<Rc<Node>>,
kind: ParameterKind,
required: bool
) -> Self
Construct a new ParameterNode
.
Trait Implementations
impl NodeOps for ParameterNode
[src]
fn accept<'text>(
&self,
parser: &mut Parser<'text>,
token: Token,
_node_ref: &Rc<Node>
)
&self,
parser: &mut Parser<'text>,
token: Token,
_node_ref: &Rc<Node>
)
Record this parameter value.
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
fn complete<'text>(&self, token: Option<Token<'text>>) -> Completion<'text>
By default named and simple parameters complete only to the token being input while flag parameters complete to the name of the flag.
fn matches(&self, _parser: &Parser, token: Token) -> bool
By default, a node matches a token
when the name of the node starts with the token
. Read more