Struct diem_management::config::Config [−][src]
pub struct Config {
pub chain_id: ChainId,
pub json_server: String,
pub shared_backend: SecureBackend,
pub validator_backend: SecureBackend,
}Expand description
A config file for working with management tooling.
Example:
use diem_management::config::ConfigPath;
use structopt::StructOpt;
#[derive(Clone, Debug, StructOpt)]
struct TestCommandLine {
#[structopt(long, required_unless("config"))]
test: Option<String>,
#[structopt(flatten)]
config: ConfigPath,
}
let config = "cmd --config test";
TestCommandLine::from_iter(config.split_whitespace());
let data = "cmd --test test";
TestCommandLine::from_iter(data.split_whitespace());
// Unfortunately there's no easy way to catch these, so these are here purley for demo:
// let help = "cmd --help";
// let result = TestCommandLine::from_iter(help.split_whitespace());
// Output:
// ...
// OPTIONS:
// --config <config> Path to a diem-management configuration file
// --test <test>
// let none = "cmd";
// let result = TestCommandLine::from_iter(none.split_whitespace());
// Output:
// error: The following required arguments were not provided:
// --test <test>
//
// USAGE:
// cmd [OPTIONS] --test <test>Config for diem management tools
Fields
chain_id: ChainIdjson_server: Stringvalidator_backend: SecureBackendImplementations
pub fn override_validator_backend(
self,
validator_backend: &Option<SecureBackend>
) -> Result<Self, Error>
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
type Output = T
type Output = T
Should always be Self
Generates a hash used only for tests.