reth_cli::chainspec

Trait 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.

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.

Implementors§