pub struct UnitInterner<'a> { /* 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<'a> UnitInterner<'a>
impl<'a> UnitInterner<'a>
Sourcepub fn new() -> UnitInterner<'a>
pub fn new() -> UnitInterner<'a>
Creates a new blank interner
Sourcepub fn intern(
&'a self,
pkg: &'a Package,
target: &'a Target,
profile: Profile,
kind: CompileKind,
mode: CompileMode,
features: Vec<InternedString>,
is_std: bool,
) -> Unit<'a>
pub fn intern( &'a self, pkg: &'a Package, target: &'a Target, profile: Profile, kind: CompileKind, mode: CompileMode, features: Vec<InternedString>, is_std: bool, ) -> Unit<'a>
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<'a> !Freeze for UnitInterner<'a>
impl<'a> !RefUnwindSafe for UnitInterner<'a>
impl<'a> !Send for UnitInterner<'a>
impl<'a> !Sync for UnitInterner<'a>
impl<'a> Unpin for UnitInterner<'a>
impl<'a> UnsafeUnpin for UnitInterner<'a>
impl<'a> UnwindSafe for UnitInterner<'a>
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