Struct clap_cargo_extra::ClapCargo
source · #[non_exhaustive]pub struct ClapCargo {
pub features: Features,
pub manifest: Manifest,
pub workspace: Workspace,
pub cargo_bin: CargoBin,
pub cargo_build: CargoBuild,
pub slop: Vec<OsString>,
}
Expand description
Combination of all three clap cargo’s arg structs and two new ones,
CargoBuild
and CargoBin
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.features: Features
§manifest: Manifest
§workspace: Workspace
§cargo_bin: CargoBin
§cargo_build: CargoBuild
§slop: Vec<OsString>
Extra arguments passed to cargo after --
Implementations§
source§impl ClapCargo
impl ClapCargo
sourcepub fn manifest_path(&self) -> Result<PathBuf>
pub fn manifest_path(&self) -> Result<PathBuf>
Current manifest path in context
sourcepub fn target_dir(&self) -> Result<PathBuf>
pub fn target_dir(&self) -> Result<PathBuf>
Directory where build artifacts will go
sourcepub fn current_packages(&self) -> Result<Vec<&Package>>
pub fn current_packages(&self) -> Result<Vec<&Package>>
Get the current packages that are selected by CLI
sourcepub fn add_cargo_args(&self, cmd: &mut Command)
👎Deprecated: use add_args instead
pub fn add_cargo_args(&self, cmd: &mut Command)
Add the correct CLI flags to a command
sourcepub fn get_deps(
&self,
p: &Package,
dep_kind: DependencyKind
) -> Result<Vec<&Package>>
pub fn get_deps( &self, p: &Package, dep_kind: DependencyKind ) -> Result<Vec<&Package>>
Returns all packages that package p
depends on transitively.
dep_kind
= Normal, Development, Build, and Unknown
Unknown is equivalent to all
pub fn channel(&self) -> &str
pub fn build_cmd(&self) -> Command
pub fn built_bin(&self, target: &Target) -> Result<PathBuf>
Trait Implementations§
source§impl Args for ClapCargo
impl Args for ClapCargo
source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
Report the [
ArgGroup::id
][crate::ArgGroup::id] for this set of argumentssource§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
source§impl FromArgMatches for ClapCargo
impl FromArgMatches for ClapCargo
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 PartialEq<ClapCargo> for ClapCargo
impl PartialEq<ClapCargo> for ClapCargo
impl Eq for ClapCargo
impl StructuralEq for ClapCargo
impl StructuralPartialEq for ClapCargo
Auto Trait Implementations§
impl RefUnwindSafe for ClapCargo
impl Send for ClapCargo
impl Sync for ClapCargo
impl Unpin for ClapCargo
impl UnwindSafe for ClapCargo
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