Trait reth_cli::chainspec::ChainSpecParser

source ·
pub trait ChainSpecParser:
    Clone
    + Send
    + Sync
    + 'static {
    type ChainSpec: Debug + Send + Sync;

    const SUPPORTED_CHAINS: &'static [&'static str];

    // Required method
    fn parse(s: &str) -> Result<Arc<Self::ChainSpec>>;

    // Provided methods
    fn parser() -> impl TypedValueParser<Value = Arc<Self::ChainSpec>> { ... }
    fn help_message() -> String { ... }
}
Expand description

Trait for parsing chain specifications.

This trait extends [clap::builder::TypedValueParser] to provide a parser for chain specifications. Implementers of this trait must provide a list of supported chains and a function to parse a given string into a chain spec.

Required Associated Constants§

source

const SUPPORTED_CHAINS: &'static [&'static str]

List of supported chains.

Required Associated Types§

source

type ChainSpec: Debug + Send + Sync

The chain specification type.

Required Methods§

source

fn parse(s: &str) -> Result<Arc<Self::ChainSpec>>

Parses the given string into a chain spec.

§Arguments
  • s - A string slice that holds the chain spec to be parsed.
§Errors

This function will return an error if the input string cannot be parsed into a valid chain spec.

Provided Methods§

source

fn parser() -> impl TypedValueParser<Value = Arc<Self::ChainSpec>>

Produces a [TypedValueParser] for this chain spec parser.

source

fn help_message() -> String

Produces a help message for the chain spec argument.

Object Safety§

This trait is not object safe.

Implementors§