Struct cargo::core::compiler::UnitInterner
source · pub struct UnitInterner { /* private fields */ }
Expand description
A small structure used to “intern” Unit
values.
A Unit
is just a thin pointer to an internal UnitInner
. This is done to
ensure that Unit
itself is quite small as well as enabling a very
efficient hash/equality implementation for Unit
. All units are
manufactured through an interner which guarantees that each equivalent value
is only produced once.
Implementations§
source§impl UnitInterner
impl UnitInterner
sourcepub fn new() -> UnitInterner
pub fn new() -> UnitInterner
Creates a new blank interner
sourcepub fn intern(
&self,
pkg: &Package,
target: &Target,
profile: Profile,
kind: CompileKind,
mode: CompileMode,
features: Vec<InternedString>,
is_std: bool,
dep_hash: u64,
artifact: IsArtifact,
artifact_target_for_features: Option<CompileTarget>
) -> Unit
pub fn intern( &self, pkg: &Package, target: &Target, profile: Profile, kind: CompileKind, mode: CompileMode, features: Vec<InternedString>, is_std: bool, dep_hash: u64, artifact: IsArtifact, artifact_target_for_features: Option<CompileTarget> ) -> Unit
Creates a new unit
from its components. The returned Unit
’s fields
will all be equivalent to the provided arguments, although they may not
be the exact same instance.