pub(super) struct UnitGenerator<'a, 'cfg> {
Show 13 fields pub ws: &'a Workspace<'cfg>, pub packages: &'a [&'a Package], pub filter: &'a CompileFilter, pub requested_kinds: &'a [CompileKind], pub explicit_host_kind: CompileKind, pub mode: CompileMode, pub resolve: &'a Resolve, pub workspace_resolve: &'a Option<Resolve>, pub resolved_features: &'a ResolvedFeatures, pub package_set: &'a PackageSet<'cfg>, pub profiles: &'a Profiles, pub interner: &'a UnitInterner, pub has_dev_units: HasDevUnits,
}
Expand description

The context needed for generating root units, which are packages the user has requested to compile.

To generate a full UnitGraph, generally you need to call generate_root_units first, and then provide the output to build_unit_dependencies.

Fields§

§ws: &'a Workspace<'cfg>§packages: &'a [&'a Package]§filter: &'a CompileFilter§requested_kinds: &'a [CompileKind]§explicit_host_kind: CompileKind§mode: CompileMode§resolve: &'a Resolve§workspace_resolve: &'a Option<Resolve>§resolved_features: &'a ResolvedFeatures§package_set: &'a PackageSet<'cfg>§profiles: &'a Profiles§interner: &'a UnitInterner§has_dev_units: HasDevUnits

Implementations§

Helper for creating a list of Unit structures

Given a list of all targets for a package, filters out only the targets that are automatically included when the user doesn’t specify any targets.

Filters the set of all possible targets based on the provided predicate.

Finds the targets for a specifically named target.

Returns a list of proposed targets based on command-line target selection flags.

Create a list of proposed targets given the context in UnitGenerator

Proposes targets from which to scrape examples for documentation

Checks if the unit list is empty and the user has passed any combination of –tests, –examples, –benches or –bins, and we didn’t match on any targets. We want to emit a warning to make sure the user knows that this run is a no-op, and their code remains unchecked despite cargo not returning any errors

Warns if a target’s required-features references a feature that doesn’t exist.

This is a warning because historically this was not validated, and it would cause too much breakage to make it an error.

Converts proposals to units based on each target’s required features.

Generates all the base units for the packages the user has requested to compile. Dependencies for these units are computed later in unit_dependencies.

Generates units specifically for doc-scraping.

This requires a separate entrypoint from generate_root_units because it takes the documented units as input.

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self
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.

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: 120 bytes