pub trait Repl<C>: Parser + Debug{
// Required methods
fn new() -> Self;
fn command(&self) -> &Option<C>;
fn step(&mut self) -> Result<(), Error>;
}Expand description
Common Trait for repl objects
Unless you want to implement custom features (not just commands), just use DefaultRepl.
Required Methods§
sourcefn step(&mut self) -> Result<(), Error>
fn step(&mut self) -> Result<(), Error>
advance the repl to the next iteration of the main loop
This should be used at the start of your loop.
Note that the help menu is an Error: clap::error::ErrorKind::DisplayHelp
§Errors
Error::Input– dialoguer User Input had some kind of I/O ErrorError::Parsing– clap could not parse the user input, or user requested helpError::Other– Any other error with anyhow,DefaultRepldoes not use this but custom implementations might
Object Safety§
This trait is not object safe.