Enum cargo::ops::Packages

source ·
pub enum Packages {
    Default,
    All,
    OptOut(Vec<String>),
    Packages(Vec<String>),
}
Expand description

Represents the selected packages that will be built.

Generally, it represents the combination of all -p flag. When working within a workspace, --exclude and --workspace flags also contribute to it.

Variants§

§

Default

Packages selected by default. Usually means no flag provided.

§

All

Opt in all packages.

As of the time of this writing, it only works on opting in all workspace members.

§

OptOut(Vec<String>)

Opt out of packages passed in.

As of the time of this writing, it only works on opting out workspace members.

§

Packages(Vec<String>)

A sequence of hand-picked packages that will be built. Normally done by -p flag.

Implementations§

Creates a Packages from flags which are generally equivalent to command line flags.

Converts selected packages to PackageIdSpecs.

Gets a list of selected Packages.

Returns whether or not the user needs to pass a -p flag to target a specific package in the workspace.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes

Size for each variant:

  • Default: 0 bytes
  • All: 0 bytes
  • OptOut: 24 bytes
  • Packages: 24 bytes