pub struct Param {
    pub key: String,
    pub filename: String,
}
Expand description

A structure to store parameters

Fields

key: Stringfilename: String

Implementations

Creates a new instance of an Param.

Examples
let matches = Command::new("myapp")
                .arg(
                    Arg::with_name("KEY")
                        .help("Key to query from the TOML file")
                        .required(true)
                        .index(1),
                    )
                .arg(
                    Arg::with_name("FILE")
                        .help("A TOML file to load")
                        .required(true)
                        .index(2),
                    )
                .get_matches_from(vec!["myapp", "key", "a.toml"]);

let param = Param::new(&matches).unwrap();
assert_eq!(param.key, "key");
assert_eq!(param.filename, "a.toml");

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.