[−][src]Struct guppy::graph::feature::FeatureGraph
A derived graph representing every feature of every package.
Constructed through PackageGraph::feature_graph
.
Implementations
impl<'g> FeatureGraph<'g>
[src]
pub fn build_warnings(&self) -> &'g [FeatureGraphWarning]
[src]
Returns any non-fatal warnings encountered while constructing the feature graph.
pub fn package_graph(&self) -> &'g PackageGraph
[src]
Returns the PackageGraph
from which this feature graph was constructed.
pub fn feature_count(&self) -> usize
[src]
Returns the total number of (package ID, feature) combinations in this graph.
Includes the "base" feature for each package.
pub fn link_count(&self) -> usize
[src]
Returns the number of links in this graph.
pub fn metadata(
&self,
feature_id: impl Into<FeatureId<'g>>
) -> Result<FeatureMetadata<'g>, Error>
[src]
&self,
feature_id: impl Into<FeatureId<'g>>
) -> Result<FeatureMetadata<'g>, Error>
Returns metadata for the given feature ID, or None
if the feature wasn't found.
pub fn all_features_for(
&self,
package_id: &PackageId
) -> Result<FeatureList<'g>, Error>
[src]
&self,
package_id: &PackageId
) -> Result<FeatureList<'g>, Error>
Returns all known features for a package.
Returns an error if the package ID was unknown.
pub fn is_default_feature<'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 feature is included in a package's build by default.
This includes transitive dependencies of the default feature.
Returns an error if this feature ID is unknown.
pub fn depends_on<'a>(
&self,
feature_a: impl Into<FeatureId<'a>>,
feature_b: impl Into<FeatureId<'a>>
) -> Result<bool, Error>
[src]
&self,
feature_a: impl Into<FeatureId<'a>>,
feature_b: impl Into<FeatureId<'a>>
) -> Result<bool, Error>
Returns true if feature_a
depends (directly or indirectly) on feature_b
.
In other words, this returns true if feature_b
is a (possibly transitive) dependency of
feature_a
.
This also returns true if feature_a
is the same as feature_b
.
pub fn directly_depends_on<'a>(
&self,
feature_a: impl Into<FeatureId<'a>>,
feature_b: impl Into<FeatureId<'a>>
) -> Result<bool, Error>
[src]
&self,
feature_a: impl Into<FeatureId<'a>>,
feature_b: impl Into<FeatureId<'a>>
) -> Result<bool, Error>
Returns true if feature_a
directly depends on feature_b
.
In other words, this returns true if feature_a
is a direct dependency of feature_b
.
This returns false if feature_a
is the same as feature_b
.
pub fn cycles(&self) -> Cycles<'g>
[src]
Returns information about dependency cycles.
For more information, see the documentation for Cycles
.
impl<'g> FeatureGraph<'g>
[src]
Helpers for property testing
The methods in this section allow a FeatureGraph
to be used in property-based testing
scenarios.
Currently, proptest 0.10 is supported if the proptest010
feature is enabled.
pub fn prop010_id_strategy(&self) -> impl Strategy<Value = FeatureId<'g>> + 'g
[src]
Returns a Strategy
that generates random feature IDs from this graph.
The IDs so chosen are uniformly random from the entire feature graph. In other words, a package with more optional features is more likely to be chosen.
Requires the proptest010
feature to be enabled.
Panics
Panics if there are no packages in the PackageGraph
from which this FeatureGraph
was
derived.
pub fn prop010_set_strategy(&self) -> impl Strategy<Value = FeatureSet<'g>> + 'g
[src]
Returns a Strategy
that generates random feature sets from this graph.
impl<'g> FeatureGraph<'g>
[src]
Queries
The methods in this section create queries over subsets of this feature graph. Use the methods here to analyze transitive dependencies.
pub fn query_workspace(
&self,
filter: impl FeatureFilter<'g>
) -> FeatureQuery<'g>
[src]
&self,
filter: impl FeatureFilter<'g>
) -> FeatureQuery<'g>
Creates a new query over the entire workspace.
query_workspace
will select all workspace packages (subject to the provided filter) and
their transitive dependencies.
pub fn query_packages(
&self,
packages: &PackageQuery<'g>,
filter: impl FeatureFilter<'g>
) -> FeatureQuery<'g>
[src]
&self,
packages: &PackageQuery<'g>,
filter: impl FeatureFilter<'g>
) -> FeatureQuery<'g>
Creates a new query for all packages selected through this PackageQuery
instance, subject
to the provided filter.
pub fn query_directed<'a>(
&self,
feature_ids: impl IntoIterator<Item = impl Into<FeatureId<'a>>>,
dep_direction: DependencyDirection
) -> Result<FeatureQuery<'g>, Error>
[src]
&self,
feature_ids: impl IntoIterator<Item = impl Into<FeatureId<'a>>>,
dep_direction: DependencyDirection
) -> Result<FeatureQuery<'g>, Error>
Creates a new query that returns transitive dependencies of the given feature IDs in the specified direction.
Returns an error if any feature IDs are unknown.
pub fn query_forward<'a>(
&self,
feature_ids: impl IntoIterator<Item = impl Into<FeatureId<'a>>>
) -> Result<FeatureQuery<'g>, Error>
[src]
&self,
feature_ids: impl IntoIterator<Item = impl Into<FeatureId<'a>>>
) -> Result<FeatureQuery<'g>, Error>
Creates a new query that returns transitive dependencies of the given feature IDs.
Returns an error if any feature IDs are unknown.
pub fn query_reverse<'a>(
&self,
feature_ids: impl IntoIterator<Item = impl Into<FeatureId<'a>>>
) -> Result<FeatureQuery<'g>, Error>
[src]
&self,
feature_ids: impl IntoIterator<Item = impl Into<FeatureId<'a>>>
) -> Result<FeatureQuery<'g>, Error>
Creates a new query that returns transitive reverse dependencies of the given feature IDs.
Returns an error if any feature IDs are unknown.
impl<'g> FeatureGraph<'g>
[src]
pub fn resolve_all(&self) -> FeatureSet<'g>
[src]
Creates a new FeatureSet
consisting of all members of this feature graph.
This will include features that aren't depended on by any workspace packages.
In most situations, query_workspace().resolve()
is preferred. Use resolve_all
if you
know you need parts of the graph that aren't accessible from the workspace.
pub fn resolve_packages(
&self,
packages: &PackageSet,
filter: impl FeatureFilter<'g>
) -> FeatureSet<'g>
[src]
&self,
packages: &PackageSet,
filter: impl FeatureFilter<'g>
) -> FeatureSet<'g>
Creates a new FeatureSet
consisting of all packages in this PackageSet
, subject to the
provided filter.
Trait Implementations
impl<'g> Clone for FeatureGraph<'g>
[src]
fn clone(&self) -> FeatureGraph<'g>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'g> Copy for FeatureGraph<'g>
[src]
impl<'g> Debug for FeatureGraph<'g>
[src]
Auto Trait Implementations
impl<'g> RefUnwindSafe for FeatureGraph<'g>
impl<'g> Send for FeatureGraph<'g>
impl<'g> Sync for FeatureGraph<'g>
impl<'g> Unpin for FeatureGraph<'g>
impl<'g> UnwindSafe for FeatureGraph<'g>
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,
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,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[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,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
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.
fn to_owned(&self) -> T
[src]
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.
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.
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>,