pub trait RethCli: Sized {
// Required methods
fn name(&self) -> Cow<'static, str>;
fn version(&self) -> Cow<'static, str>;
// Provided methods
fn parse_args() -> Result<Self, Error>
where Self: Parser { ... }
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where Self: Parser,
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone { ... }
fn with_runner<F, R>(self, f: F) -> R
where F: FnOnce(Self, CliRunner) -> R { ... }
fn execute<F, R>(f: F) -> Result<R, Error>
where Self: Parser,
F: FnOnce(Self, CliRunner) -> R { ... }
}
Expand description
Reth based node cli.
This trait is supposed to be implemented by the main struct of the CLI.
It provides commonly used functionality for running commands and information about the CL, such as the name and version.
Required Methods§
Provided Methods§
sourcefn parse_args() -> Result<Self, Error>where
Self: Parser,
fn parse_args() -> Result<Self, Error>where
Self: Parser,
Parse args from iterator from std::env::args_os()
.
sourcefn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse args from the given iterator.
sourcefn with_runner<F, R>(self, f: F) -> Rwhere
F: FnOnce(Self, CliRunner) -> R,
fn with_runner<F, R>(self, f: F) -> Rwhere
F: FnOnce(Self, CliRunner) -> R,
Executes a command.
Object Safety§
This trait is not object safe.