Node

Trait Node 

Source
pub trait Node<P, R> {
    // Required methods
    fn name(&self) -> &str;
    fn command(&self) -> Command;
    fn children_nodes(&self) -> Vec<Box<dyn Node<P, R>>>;
    fn pre_f(&self) -> Option<NodePreFn<P>>;
    fn f(&self) -> Option<NodeFn<P, R>>;
}
Expand description

Represents a command in the command tree.

Required Methods§

Source

fn name(&self) -> &str

The clap ID name for the command node.

Source

fn command(&self) -> Command

The clap command.

Source

fn children_nodes(&self) -> Vec<Box<dyn Node<P, R>>>

Subcommand nodes.

Source

fn pre_f(&self) -> Option<NodePreFn<P>>

A function used to transform custom parameters.

Source

fn f(&self) -> Option<NodeFn<P, R>>

The function to run when the node command is called.

Implementors§