Struct probe_rs_cli_util::common_options::CargoOptions[][src]

pub struct CargoOptions {
    pub bin: Option<String>,
    pub example: Option<String>,
    pub package: Option<String>,
    pub release: bool,
    pub target: Option<String>,
    pub manifest_path: Option<PathBuf>,
    pub no_default_features: bool,
    pub all_features: bool,
    pub features: Vec<String>,
    pub trailing_opts: Vec<String>,
}
Expand description

Common options used when building artifacts with cargo.

Fields

bin: Option<String>example: Option<String>package: Option<String>release: booltarget: Option<String>manifest_path: Option<PathBuf>no_default_features: boolall_features: boolfeatures: Vec<String>trailing_opts: Vec<String>

Escape hatch: all args passed after a sentinel -- end up here, unprocessed. Used to pass arguments to cargo not declared in CargoOptions.

Implementations

Generates a suitable help string to append to your program’s –help. Example usage:

use probe_rs_cli_util::common_options::{FlashOptions, CargoOptions};
use probe_rs_cli_util::structopt::StructOpt;

let matches = FlashOptions::clap()
    .bin_name("cargo flash")
    .after_help(CargoOptions::help_message("cargo flash").as_str())
    .get_matches_from(std::env::args());
let opts = FlashOptions::from_clap(&matches);

Generates list of arguments to cargo from a CargoOptions. For example, if CargoOptions::release is set, resultant list will contain a "--release".

Trait Implementations

Formats the value using the given formatter. Read more

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

Returns clap::App corresponding to the struct.

Builds the struct from clap::ArgMatches. It’s guaranteed to succeed if matches originates from an App generated by StructOpt::clap called on the same type, otherwise it must panic. Read more

Builds the struct from the command line arguments (std::env::args_os). Calls clap::Error::exit on failure, printing the error message and aborting the program. Read more

Builds the struct from the command line arguments (std::env::args_os). Unlike StructOpt::from_args, returns clap::Error on failure instead of aborting the program, so calling .exit is up to you. Read more

Gets the struct from any iterator such as a Vec of your making. Print the error message and quit the program in case of failure. Read more

Gets the struct from any iterator such as a Vec of your making. 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.

Performs the conversion.

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.