Struct probe_rs_cli_util::common_options::CargoOptions
source · [−]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
sourceimpl CargoOptions
impl CargoOptions
sourcepub fn help_message(bin: &str) -> String
pub fn help_message(bin: &str) -> String
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::clap::Parser;
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);Trait Implementations
sourceimpl Args for CargoOptions
impl Args for CargoOptions
sourceimpl CommandFactory for CargoOptions
impl CommandFactory for CargoOptions
sourcefn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
Deprecated, replaced with CommandFactory::command_for_update
sourcefn command_for_update<'help>() -> App<'help>
fn command_for_update<'help>() -> App<'help>
sourceimpl Debug for CargoOptions
impl Debug for CargoOptions
sourceimpl Default for CargoOptions
impl Default for CargoOptions
sourcefn default() -> CargoOptions
fn default() -> CargoOptions
Returns the “default value” for a type. Read more
sourceimpl FromArgMatches for CargoOptions
impl FromArgMatches for CargoOptions
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
sourcefn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
sourcefn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches to self.
sourcefn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches to self.
sourceimpl Parser for CargoOptions
impl Parser for CargoOptions
sourcefn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, exit on error
sourcefn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, return Err on error.
sourcefn update_from<I, T>(&mut self, itr: I) where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn update_from<I, T>(&mut self, itr: I) where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, exit on error
sourcefn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error> where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, return Err on error.
Auto Trait Implementations
impl RefUnwindSafe for CargoOptions
impl Send for CargoOptions
impl Sync for CargoOptions
impl Unpin for CargoOptions
impl UnwindSafe for CargoOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more