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
sourceimpl 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
) -> Unit
pub fn intern(
&self,
pkg: &Package,
target: &Target,
profile: Profile,
kind: CompileKind,
mode: CompileMode,
features: Vec<InternedString>,
is_std: bool,
dep_hash: u64
) -> 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 !RefUnwindSafe for UnitInterner
impl !Send for UnitInterner
impl !Sync for UnitInterner
impl Unpin for UnitInterner
impl UnwindSafe for UnitInterner
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more