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>,
rustflags: Rc<[String]>,
rustdocflags: Rc<[String]>,
links_overrides: Rc<BTreeMap<String, BuildOutput>>,
is_std: bool,
dep_hash: u64,
artifact: IsArtifact,
artifact_target_for_features: Option<CompileTarget>,
skip_non_compile_time_dep: bool,
) -> Unit
pub fn intern( &self, pkg: &Package, target: &Target, profile: Profile, kind: CompileKind, mode: CompileMode, features: Vec<InternedString>, rustflags: Rc<[String]>, rustdocflags: Rc<[String]>, links_overrides: Rc<BTreeMap<String, BuildOutput>>, is_std: bool, dep_hash: u64, artifact: IsArtifact, artifact_target_for_features: Option<CompileTarget>, skip_non_compile_time_dep: bool, ) -> 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.
Auto Trait Implementations§
impl !Freeze for UnitInterner
impl !RefUnwindSafe for UnitInterner
impl !Send for UnitInterner
impl !Sync for UnitInterner
impl Unpin for UnitInterner
impl UnwindSafe for UnitInterner
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more