pub struct InternedRef<'a, T> { /* private fields */ }Implementations§
Source§impl<'a, T: Internable> InternedRef<'a, T>
impl<'a, T: Internable> InternedRef<'a, T>
pub fn as_raw(self) -> *const T
Sourcepub unsafe fn from_raw(ptr: *const T) -> Self
pub unsafe fn from_raw(ptr: *const T) -> Self
§Safety
The pointer needs to originate from Interned or InternedRef.
pub fn to_owned(self) -> Interned<T>
pub fn get(self) -> &'a T
Sourcepub unsafe fn decrement_refcount(self)
pub unsafe fn decrement_refcount(self)
§Safety
You have to make sure the data is not referenced after the refcount reaches zero; beware the interning map also keeps a reference to the value.
Sourcepub fn change_lifetime<'b>(self) -> InternedRef<'b, T>
pub fn change_lifetime<'b>(self) -> InternedRef<'b, T>
Available only on GC mode.
Changes the attached lifetime, as in GC mode, the lifetime is more kind of a lint to prevent misuse than actual soundness check.
Trait Implementations§
Source§impl<T> Clone for InternedRef<'_, T>
impl<T> Clone for InternedRef<'_, T>
Source§impl<T: Debug> Debug for InternedRef<'_, T>
impl<T: Debug> Debug for InternedRef<'_, T>
Source§impl<T> Deref for InternedRef<'_, T>
impl<T> Deref for InternedRef<'_, T>
Source§impl<T: Display> Display for InternedRef<'_, T>
impl<T: Display> Display for InternedRef<'_, T>
Source§impl<T: Hash> Hash for InternedRef<'_, T>
impl<T: Hash> Hash for InternedRef<'_, T>
Source§impl<T: PartialEq> PartialEq for InternedRef<'_, T>
impl<T: PartialEq> PartialEq for InternedRef<'_, T>
impl<T> Copy for InternedRef<'_, T>
impl<T: Eq> Eq for InternedRef<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for InternedRef<'a, T>
impl<'a, T> RefUnwindSafe for InternedRef<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for InternedRef<'a, T>
impl<'a, T> Sync for InternedRef<'a, T>
impl<'a, T> Unpin for InternedRef<'a, T>
impl<'a, T> UnwindSafe for InternedRef<'a, T>where
T: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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>
Converts
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>
Converts
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