Struct guppy::graph::feature::FeatureSet [−][src]
A set of resolved feature IDs in a feature graph.
Created by FeatureQuery::resolve
, the FeatureGraph::resolve_
methods, or from
PackageSet::to_feature_set
.
Implementations
impl<'g> FeatureSet<'g>
[src]
pub fn graph(&self) -> &FeatureGraph<'g>
[src]
Returns the FeatureGraph
that this feature set was computed against.
pub fn len(&self) -> usize
[src]
Returns the number of feature IDs in this set.
pub fn is_empty(&self) -> bool
[src]
Returns true if no feature IDs were resolved in this set.
pub fn contains<'a>(
&self,
feature_id: impl Into<FeatureId<'a>>
) -> Result<bool, Error>
[src]
&self,
feature_id: impl Into<FeatureId<'a>>
) -> Result<bool, Error>
Returns true if this set contains the given feature ID.
Returns an error if this feature ID was unknown.
pub fn contains_package(&self, package_id: &PackageId) -> Result<bool, Error>
[src]
Returns true if this set contains this package.
Returns an error if this package ID was unknown.
pub fn to_feature_query(
&self,
direction: DependencyDirection
) -> FeatureQuery<'g>
[src]
&self,
direction: DependencyDirection
) -> FeatureQuery<'g>
Creates a new FeatureQuery
from this set in the specified direction.
This is equivalent to constructing a query from all the feature IDs in this set.
pub fn union(&self, other: &Self) -> Self
[src]
Returns a FeatureSet
that contains all packages present in at least one of self
and other
.
Panics
Panics if the package graphs associated with self
and other
don't match.
pub fn intersection(&self, other: &Self) -> Self
[src]
Returns a FeatureSet
that contains all packages present in both self
and other
.
Panics
Panics if the package graphs associated with self
and other
don't match.
pub fn difference(&self, other: &Self) -> Self
[src]
Returns a FeatureSet
that contains all packages present in self
but not other
.
Panics
Panics if the package graphs associated with self
and other
don't match.
pub fn symmetric_difference(&self, other: &Self) -> Self
[src]
Returns a FeatureSet
that contains all packages present in exactly one of self
and
other
.
Panics
Panics if the package graphs associated with self
and other
don't match.
pub fn features_for(
&self,
package_id: &PackageId
) -> Result<Option<FeatureList<'g>>, Error>
[src]
&self,
package_id: &PackageId
) -> Result<Option<FeatureList<'g>>, Error>
Returns a list of features present for this package, or None
if this package is not
present in the feature set.
Returns an error if the package ID was unknown.
pub fn to_package_set(&self) -> PackageSet<'g>
[src]
Converts this FeatureSet
into a PackageSet
containing all packages with any selected
features (including the "base" feature).
pub fn into_cargo_set(
self,
opts: &CargoOptions<'_>
) -> Result<CargoSet<'g>, Error>
[src]
self,
opts: &CargoOptions<'_>
) -> Result<CargoSet<'g>, Error>
Converts this feature set into a Cargo set, simulating a Cargo build for it.
The feature set is expected to be entirely within the workspace. Its behavior outside the workspace isn't defined and may be surprising.
Returns an error if the CargoOptions
weren't valid in some way (for example if an omitted
package ID wasn't known to this graph.)
pub fn feature_ids<'a>(
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureId<'g>> + ExactSizeIterator + 'a
[src]
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureId<'g>> + ExactSizeIterator + 'a
Iterates over feature IDs, in topological order in the direction specified.
Cycles
The features within a dependency cycle will be returned in non-dev order. When the direction is forward, if feature Foo has a dependency on Bar, and Bar has a cyclic dev-dependency on Foo, then Foo is returned before Bar.
pub fn features<'a>(
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureMetadata<'g>> + ExactSizeIterator + 'a
[src]
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureMetadata<'g>> + ExactSizeIterator + 'a
Iterates over feature metadatas, in topological order in the direction specified.
Cycles
The features within a dependency cycle will be returned in non-dev order. When the direction is forward, if feature Foo has a dependency on Bar, and Bar has a cyclic dev-dependency on Foo, then Foo is returned before Bar.
pub fn packages_with_features<'a>(
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureList<'g>> + 'a
[src]
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureList<'g>> + 'a
Iterates over package metadatas and their corresponding features, in topological order in the direction specified.
Cycles
The packages within a dependency cycle will be returned in non-dev order. When the direction is forward, if package Foo has a dependency on Bar, and Bar has a cyclic dev-dependency on Foo, then Foo is returned before Bar.
pub fn root_ids<'a>(
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureId<'g>> + ExactSizeIterator + 'a
[src]
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureId<'g>> + ExactSizeIterator + 'a
Returns the set of "root feature" IDs in the specified direction.
- If direction is Forward, return the set of feature IDs that do not have any dependencies within the selected graph.
- If direction is Reverse, return the set of feature IDs that do not have any dependents within the selected graph.
Cycles
If a root consists of a dependency cycle, all the packages in it will be returned in non-dev order (when the direction is forward).
pub fn root_features<'a>(
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureMetadata<'g>> + 'a
[src]
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = FeatureMetadata<'g>> + 'a
Returns the set of "root feature" metadatas in the specified direction.
- If direction is Forward, return the set of metadatas that do not have any dependencies within the selected graph.
- If direction is Reverse, return the set of metadatas that do not have any dependents within the selected graph.
Cycles
If a root consists of a dependency cycle, all the packages in it will be returned in non-dev order (when the direction is forward).
pub fn cross_links<'a>(
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = CrossLink<'g>> + 'a
[src]
&'a self,
direction: DependencyDirection
) -> impl Iterator<Item = CrossLink<'g>> + 'a
Creates an iterator over CrossLink
instances in the direction specified.
Cycles
The links in a dependency cycle will be returned in non-dev order. When the direction is forward, if feature Foo has a dependency on Bar, and Bar has a cyclic dev-dependency on Foo, then the link Foo -> Bar is returned before the link Bar -> Foo.
Trait Implementations
impl<'g> Clone for FeatureSet<'g>
[src]
fn clone(&self) -> FeatureSet<'g>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'g> Debug for FeatureSet<'g>
[src]
impl<'g> Eq for FeatureSet<'g>
[src]
impl<'g> PartialEq<FeatureSet<'g>> for FeatureSet<'g>
[src]
Auto Trait Implementations
impl<'g> RefUnwindSafe for FeatureSet<'g>
[src]
impl<'g> Send for FeatureSet<'g>
[src]
impl<'g> Sync for FeatureSet<'g>
[src]
impl<'g> Unpin for FeatureSet<'g>
[src]
impl<'g> UnwindSafe for FeatureSet<'g>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
[src]
T: 'a + Clone + Send + Sync,
pub fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
[src]
pub fn self_address_mut(&mut self) -> *mut ()
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
[src]
T: 'a + Clone,
pub fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
[src]
pub fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_replacement(ptr: &T) -> &T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,