#[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

source

pub fn metadata(&self) -> Result<&Metadata>

Current metadata for the CLI’s context

source

pub fn manifest_path(&self) -> Result<PathBuf>

Current manifest path in context

source

pub fn target_dir(&self) -> Result<PathBuf>

Directory where build artifacts will go

source

pub fn current_packages(&self) -> Result<Vec<&Package>>

Get the current packages that are selected by CLI

source

pub fn packages(&self) -> Result<Vec<&Package>>

All packages referenced

source

pub fn add_cargo_args(&self, cmd: &mut Command)

👎Deprecated: use add_args instead

Add the correct CLI flags to a command

source

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

source

pub fn cargo_cmd(&self) -> Command

Create a Command builder for cargo

source

pub fn channel(&self) -> &str

source

pub fn build_cmd(&self) -> Command

source

pub fn find_package(&self, name: &str) -> Result<Option<&Package>>

Find package given a name

source

pub fn built_bin(&self, target: &Target) -> Result<PathBuf>

Trait Implementations§

source§

impl Args for ClapCargo

source§

impl Args for ClapCargo

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl Clone for ClapCargo

source§

fn clone(&self) -> ClapCargo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ClapCargo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ClapCargo

source§

fn default() -> ClapCargo

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

impl FromArgMatches for ClapCargo

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

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>

Assign values from ArgMatches to self.
source§

impl Merge for ClapCargo

source§

fn merge(&mut self, other: Self)

source§

impl PartialEq<ClapCargo> for ClapCargo

source§

fn eq(&self, other: &ClapCargo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for ClapCargo

source§

impl StructuralEq for ClapCargo

source§

impl StructuralPartialEq for ClapCargo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToCmd for Twhere T: Args,

source§

fn add_args<'a>(&'a self, cmd: &'a mut Command) -> &'a mut Command

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.