Struct intern_arc::Interned [−][src]
Implementations
impl<T: ?Sized> Interned<T>[src]
An interned value
This type works very similar to an Arc
with the difference that it has no concept of weak references. They are not needed because
interned values must not be modified, so reference cycles cannot be constructed. One
reference is held by the interner that created this value as long as that interner lives.
Keeping interned values around does not keep the interner alive: once the last reference to
the interner is dropped, it will release its existing interned values, so the backing memory
will be released once each of the interned values is no longer referenced through any Interned
instances. (Interned keeps a Weak
reference to the interner that created it, so it will prevent the ArcInner from being
deallocated while it lives.)
pub fn ref_count(&self) -> usize[src]
Obtain current number of references, including this one, using
Ordering::Relaxed.
This means that reads and writes of your code may be freely reordered around this
read, there is no synchronisation with other threads.
The value will always be at least 1. If the value is 1, this means that the interner which produced this reference has been dropped; in this case you are still free to use this reference in any way you like.
Trait Implementations
impl<T: ?Sized> AsRef<T> for Interned<T>[src]
impl<T: ?Sized> Borrow<T> for Interned<T>[src]
impl<T: ?Sized> Clone for Interned<T>[src]
fn clone(&self) -> Self[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<T: ?Sized + Debug> Debug for Interned<T>[src]
impl<T: ?Sized> Deref for Interned<T>[src]
impl<T: ?Sized + Display> Display for Interned<T>[src]
impl<T: ?Sized> Drop for Interned<T>[src]
impl<T: ?Sized + Eq> Eq for Interned<T>[src]
impl<T: ?Sized + Hash> Hash for Interned<T>[src]
fn hash<H: Hasher>(&self, state: &mut H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<T: ?Sized + Ord> Ord for Interned<T>[src]
fn cmp(&self, other: &Self) -> Ordering[src]
#[must_use]pub fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self1.50.0[src]
impl<T: ?Sized + PartialEq> PartialEq<Interned<T>> for Interned<T>[src]
impl<T: ?Sized + PartialOrd> PartialOrd<Interned<T>> for Interned<T>[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<T: ?Sized> Pointer for Interned<T>[src]
impl<T: ?Sized + Sync + Send> Send for Interned<T>[src]
impl<T: ?Sized + Sync + Send> Sync for Interned<T>[src]
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for Interned<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized> Unpin for Interned<T>
impl<T: ?Sized> UnwindSafe for Interned<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,