pub struct ResolvedFeatures {
activated_features: HashMap<(PackageId, FeaturesFor), BTreeSet<InternedString>>,
activated_dependencies: HashMap<(PackageId, FeaturesFor), BTreeSet<InternedString>>,
opts: FeatureOpts,
}
Expand description
Set of all activated features for all packages in the resolve graph.
Fields§
§activated_features: HashMap<(PackageId, FeaturesFor), BTreeSet<InternedString>>
§activated_dependencies: HashMap<(PackageId, FeaturesFor), BTreeSet<InternedString>>
Optional dependencies that should be built.
The value is the name_in_toml
of the dependencies.
opts: FeatureOpts
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
).
fn activated_features_int( &self, pkg_id: PackageId, features_for: FeaturesFor, ) -> CargoResult<Vec<InternedString>>
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.
Auto Trait Implementations§
impl Freeze for ResolvedFeatures
impl RefUnwindSafe for ResolvedFeatures
impl Send for ResolvedFeatures
impl Sync for ResolvedFeatures
impl Unpin for ResolvedFeatures
impl UnwindSafe for ResolvedFeatures
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<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: 104 bytes