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§
source§impl Packages
impl Packages
sourcepub fn from_flags(
all: bool,
exclude: Vec<String>,
package: Vec<String>
) -> CargoResult<Self>
pub fn from_flags( all: bool, exclude: Vec<String>, package: Vec<String> ) -> CargoResult<Self>
Creates a Packages
from flags which are generally equivalent to command line flags.
sourcepub fn to_package_id_specs(
&self,
ws: &Workspace<'_>
) -> CargoResult<Vec<PackageIdSpec>>
pub fn to_package_id_specs( &self, ws: &Workspace<'_> ) -> CargoResult<Vec<PackageIdSpec>>
Converts selected packages to PackageIdSpec
s.
sourcepub fn get_packages<'ws>(
&self,
ws: &'ws Workspace<'_>
) -> CargoResult<Vec<&'ws Package>>
pub fn get_packages<'ws>( &self, ws: &'ws Workspace<'_> ) -> CargoResult<Vec<&'ws Package>>
Gets a list of selected Package
s.
sourcepub fn needs_spec_flag(&self, ws: &Workspace<'_>) -> bool
pub fn needs_spec_flag(&self, ws: &Workspace<'_>) -> bool
Returns whether or not the user needs to pass a -p
flag to target a
specific package in the workspace.
Trait Implementations§
source§impl PartialEq<Packages> for Packages
impl PartialEq<Packages> for Packages
impl Eq for Packages
impl StructuralEq for Packages
impl StructuralPartialEq for Packages
Auto Trait Implementations§
impl RefUnwindSafe for Packages
impl Send for Packages
impl Sync for Packages
impl Unpin for Packages
impl UnwindSafe for Packages
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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 bytesAll
: 0 bytesOptOut
: 24 bytesPackages
: 24 bytes