Trait reth_cli::RethCli

source ·
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§

source

fn name(&self) -> Cow<'static, str>

The name of the implementation, eg. reth, op-reth, etc.

source

fn version(&self) -> Cow<'static, str>

The version of the node, such as reth/v1.0.0

Provided Methods§

source

fn parse_args() -> Result<Self, Error>
where Self: Parser,

Parse args from iterator from std::env::args_os().

source

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where Self: Parser, I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse args from the given iterator.

source

fn with_runner<F, R>(self, f: F) -> R
where F: FnOnce(Self, CliRunner) -> R,

Executes a command.

source

fn execute<F, R>(f: F) -> Result<R, Error>
where Self: Parser, F: FnOnce(Self, CliRunner) -> R,

Parses and executes a command.

Object Safety§

This trait is not object safe.

Implementors§