pub struct FeatureSet<'g> { /* private fields */ }
Expand description

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

Returns the FeatureGraph that this feature set was computed against.

Returns the number of feature IDs in this set.

Returns true if no feature IDs were resolved in this set.

Returns true if this set contains the given feature ID.

Returns an error if this feature ID was unknown.

Returns true if this set contains this package.

Returns an error if this package ID was unknown.

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.

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.

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.

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.

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.

Returns a PackageSet on which a filter has been applied.

Filters out all values for which the callback returns false.

Cycles

For packages within a dependency cycle, the callback will be called 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.

Partitions this PackageSet into two.

The first PackageSet contains packages for which the callback returned true, and the second one contains packages for which the callback returned false.

Cycles

For packages within a dependency cycle, the callback will be called 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.

Performs filtering and partitioning at the same time.

The first PackageSet contains packages for which the callback returned Some(true), and the second one contains packages for which the callback returned Some(false). Packages for which the callback returned None are dropped.

Cycles

For packages within a dependency cycle, the callback will be called 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.

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.

Converts this FeatureSet into a PackageSet containing all packages with any selected features (including the “base” feature).

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.)

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.

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.

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.

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).

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).

Creates an iterator over ConditionalLink 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.