Struct commands::parser::CommandNode
[−]
[src]
pub struct CommandNode { pub node: TreeNode, pub handler: Option<fn(node: Node)>, pub parameters: Vec<Rc<Node>>, pub wrapped_root: Option<Rc<Node>>, }
A node representing a command. Constructed via Command
and CommandTree
.
If wrapped_root
is set then this node wraps another command.
This is used for the help command so that it can complete
normal commands. The successors
will be those of the wrapped node.
Fields
node |
|
handler | The handler which is executed once this node has been accepted. |
parameters | Parameter nodes for this command |
wrapped_root | If present, the command wrapped by this node. |
Methods
impl CommandNode
fn new(name: &str, help_text: Option<&str>, hidden: bool, priority: i32, successors: Vec<Rc<Node>>, handler: Option<fn(node: Node)>, parameters: Vec<Rc<Node>>) -> Self
Construct a new CommandNode
.