pub struct ResolvedFeatures { /* private fields */ }
Expand description
Set of all activated features for all packages in the resolve graph.
Implementations§
source§impl ResolvedFeatures
impl ResolvedFeatures
sourcepub fn activated_features(
&self,
pkg_id: PackageId,
features_for: FeaturesFor
) -> Vec<InternedString>
pub fn activated_features( &self, pkg_id: PackageId, features_for: FeaturesFor ) -> Vec<InternedString>
Returns the list of features that are enabled for the given package.
sourcepub fn is_dep_activated(
&self,
pkg_id: PackageId,
features_for: FeaturesFor,
dep_name: InternedString
) -> bool
pub fn is_dep_activated( &self, pkg_id: PackageId, features_for: FeaturesFor, dep_name: InternedString ) -> bool
Returns if the given dependency should be included.
This handles dependencies disabled via cfg
expressions and optional
dependencies which are not enabled.
sourcepub fn activated_features_unverified(
&self,
pkg_id: PackageId,
features_for: FeaturesFor
) -> Option<Vec<InternedString>>
pub fn activated_features_unverified( &self, pkg_id: PackageId, features_for: FeaturesFor ) -> Option<Vec<InternedString>>
Variant of activated_features
that returns None
if this is
not a valid pkg_id/is_build combination. Used in places which do
not know which packages are activated (like cargo clean
).
sourcepub fn compare_legacy(&self, legacy: &ResolvedFeatures) -> DiffMap
pub fn compare_legacy(&self, legacy: &ResolvedFeatures) -> DiffMap
Compares the result against the original resolver behavior.
Used by cargo fix --edition
to display any differences.