pub struct UnitInterner {
state: RefCell<InternerState>,
}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.
Fields§
§state: RefCell<InternerState>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.
fn intern_inner(&self, item: &UnitInner) -> Rc<UnitInner>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
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: 56 bytes