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§
impl Eq for Packages
impl StructuralPartialEq for Packages
Auto Trait Implementations§
impl Freeze for Packages
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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