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: bool§target: Option<String>§manifest_path: Option<PathBuf>§no_default_features: bool§all_features: bool§features: 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§
Source§impl 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, CommandFactory, FromArgMatches};
let help_message = CargoOptions::help_message("cargo flash");
let matches = FlashOptions::command()
.bin_name("cargo flash")
.after_help(&help_message)
.get_matches_from(std::env::args());
let opts = FlashOptions::from_arg_matches(&matches);Sourcepub fn to_cargo_options(&self) -> Vec<String>
pub fn to_cargo_options(&self) -> Vec<String>
Generates list of arguments to cargo from a CargoOptions. For
example, if CargoOptions::release is set, resultant list will
contain a "--release".
Trait Implementations§
Source§impl Args for CargoOptions
impl Args for CargoOptions
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for CargoOptions
impl CommandFactory for CargoOptions
Source§impl Debug for CargoOptions
impl Debug for CargoOptions
Source§impl Default for CargoOptions
impl Default for CargoOptions
Source§fn default() -> CargoOptions
fn default() -> CargoOptions
Returns the “default value” for a type. Read more
Source§impl FromArgMatches for CargoOptions
impl FromArgMatches for CargoOptions
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn 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>
Source§fn 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.Source§fn 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.Source§impl Parser for CargoOptions
impl Parser for CargoOptions
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for CargoOptions
impl RefUnwindSafe for CargoOptions
impl Send for CargoOptions
impl Sync for CargoOptions
impl Unpin for CargoOptions
impl UnwindSafe for CargoOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more