Struct cargo::core::compiler::UnitInterner
source · 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>,
) -> 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>, ) -> 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>
§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>
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