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 default_value() -> Option<&'static str> { ... }
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§
Sourceconst SUPPORTED_CHAINS: &'static [&'static str]
const SUPPORTED_CHAINS: &'static [&'static str]
List of supported chains.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn default_value() -> Option<&'static str>
fn default_value() -> Option<&'static str>
The default value for the chain spec parser.
Sourcefn parser() -> impl TypedValueParser<Value = Arc<Self::ChainSpec>>
fn parser() -> impl TypedValueParser<Value = Arc<Self::ChainSpec>>
Produces a [TypedValueParser
] for this chain spec parser.
Sourcefn help_message() -> String
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.