pub struct Istr(/* private fields */);
Expand description
An ID for an interned string. Cheap to copy, and to perform equality checks on, as
internally it is simply a NonZeroU32
ID. It can also be stored inside an Option
for free
due to niche optimisation.
In order to get the associated string, the interned string must be looked up in the interner it was created with.
Note that performing an equality check on interned strings from different interners will give a nonsensical result.
Trait Implementations§
impl Copy for Istr
impl Eq for Istr
impl StructuralPartialEq for Istr
Auto Trait Implementations§
impl Freeze for Istr
impl RefUnwindSafe for Istr
impl Send for Istr
impl Sync for Istr
impl Unpin for Istr
impl UnwindSafe for Istr
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