pub struct Interned<T: Internable> {
arc: Arc<T>,
}Fields§
§arc: Arc<T>Implementations§
Source§impl<T: Internable> Interned<T>
impl<T: Internable> Interned<T>
pub fn new(obj: T) -> Self
pub fn new_gc<'a>(obj: T) -> InternedRef<'a, T>
fn select( storage: &'static DashMap<Arc<T>, (), FxBuildHasher>, obj: &T, ) -> (RwLockWriteGuard<'static, RawTable<(Arc<T>, SharedValue<()>)>>, u64)
fn hash(storage: &'static DashMap<Arc<T>, (), FxBuildHasher>, obj: &T) -> u64
Sourcepub unsafe fn from_raw(ptr: *const T) -> Self
pub unsafe fn from_raw(ptr: *const T) -> Self
§Safety
The pointer should originate from an Interned or an InternedRef.
pub fn as_ref(&self) -> InternedRef<'_, T>
Trait Implementations§
Source§impl<T: Internable> AsRef<T> for Interned<T>
impl<T: Internable> AsRef<T> for Interned<T>
Source§impl<T: Internable> Clone for Interned<T>
impl<T: Internable> Clone for Interned<T>
Source§impl<T: Internable> Deref for Interned<T>
impl<T: Internable> Deref for Interned<T>
Source§impl<T: Internable> Drop for Interned<T>
impl<T: Internable> Drop for Interned<T>
Source§impl<T: Internable> Hash for Interned<T>
impl<T: Internable> Hash for Interned<T>
Source§impl<T: Internable> PartialEq for Interned<T>
Compares interned Refs using pointer equality.
impl<T: Internable> PartialEq for Interned<T>
Compares interned Refs using pointer equality.
impl<T: Internable> Eq for Interned<T>
Auto Trait Implementations§
impl<T> Freeze for Interned<T>
impl<T> RefUnwindSafe for Interned<T>where
T: RefUnwindSafe,
impl<T> Send for Interned<T>
impl<T> Sync for Interned<T>
impl<T> Unpin for Interned<T>where
T: Unpin,
impl<T> UnwindSafe for Interned<T>where
T: UnwindSafe + 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