pub trait RethCli: Sized {
type ChainSpecParser: ChainSpecParser;
// Required methods
fn name(&self) -> Cow<'static, str>;
fn version(&self) -> Cow<'static, str>;
fn client_version() -> ClientVersion;
// 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 Associated Types§
Sourcetype ChainSpecParser: ChainSpecParser
type ChainSpecParser: ChainSpecParser
The associated ChainSpecParser
type
Required Methods§
Sourcefn client_version() -> ClientVersion
fn client_version() -> ClientVersion
The client version of the node.
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.