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: Stringshared_backend: SecureBackendvalidator_backend: SecureBackend

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

Generates a hash used only for tests.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.