Struct guppy::graph::cargo::CargoSet[][src]

pub struct CargoSet<'g> { /* fields omitted */ }
Expand description

A set of packages and features, as would be built by Cargo.

Cargo implements a set of algorithms to figure out which packages or features are built in a given situation. guppy implements those algorithms.

Implementations

Simulates a Cargo build of this feature set, with the given options.

The feature sets are expected to be entirely within the workspace. Its behavior outside the workspace isn’t defined and may be surprising.

CargoSet::new takes two FeatureSet instances:

  • initials, from which dependencies are followed to build the CargoSet.
  • features_only, which are additional inputs that are only used for feature unification. This may be used to simulate, e.g. cargo build --package foo --package bar, when you only care about the results of foo but specifying bar influences the build.

Note that even if a package is in features_only, it may be included in the final build set through other means (for example, if it is also in initials or it is a dependency of one of them).

In many cases features_only is empty – in that case you may wish to use FeatureSet::into_cargo_set(), and it may be more convenient to use that if the code is written in a “fluent” style.

Returns the feature graph for this CargoSet instance.

Returns the package graph for this CargoSet instance.

Returns the initial packages and features from which the CargoSet instance was constructed.

Returns the packages and features that took part in feature unification but were not considered part of the final result.

For more about features_only and how it influences the build, see the documentation for CargoSet::new.

Returns the feature set enabled on the target platform.

This represents the packages and features that are included as code in the final build artifacts. This is relevant for both cross-compilation and auditing.

Returns the feature set enabled on the host platform.

This represents the packages and features that influence the final build artifacts, but whose code is generally not directly included.

This includes all procedural macros, including those specified in the initial query.

Returns the feature set enabled on the specified build platform.

Returns the feature sets across the target and host build platforms.

Returns the set of workspace and direct dependency packages on the target platform.

The packages in this set are a subset of the packages in target_features.

Returns the set of workspace and direct dependency packages on the host platform.

The packages in this set are a subset of the packages in host_features.

Returns the set of workspace and direct dependency packages on the specified build platform.

Returns the set of workspace and direct dependency packages across the target and host build platforms.

Returns PackageLink instances for procedural macro dependencies from target packages.

Procedural macros straddle the line between target and host: they’re built for the host but generate code that is compiled for the target platform.

Notes

Procedural macro packages will be included in the host feature set.

The returned iterator will include proc macros that are depended on normally or in dev builds from initials (if include_dev is set), but not the ones in the [build-dependencies] section.

Returns PackageLink instances for build dependencies from target packages.

Notes

For each link, the from is built on the target while the to is built on the host. It is possible (though rare) that a build dependency is also included as a normal dependency, or as a dev dependency in which case it will also be built on the target.

The returned iterators will not include build dependencies of host packages – those are also built on the host.

Creates a build summary with the given options.

Requires the summaries feature to be enabled.

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

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

Performs the conversion.

Performs the conversion.

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.