Struct intern_arc::InternedHash [−][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 references to interned values by dropping its set implementation. Only the direct allocation size of the set implementation remains allocated (but no longer functional) until the last weak reference to the interner goes away — each interned value keeps one such weak reference to its interner.
Implementations
impl<T: ?Sized + Eq + Hash> InternedHash<T>
[src]
pub fn ref_count(&self) -> u32
[src]
Obtain current number of references, including this one.
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 + Eq + Hash> AsRef<T> for InternedHash<T>
[src]
impl<T: ?Sized + Eq + Hash> Borrow<T> for InternedHash<T>
[src]
impl<T: ?Sized + Eq + Hash> Clone for InternedHash<T>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: ?Sized + Eq + Hash> Debug for InternedHash<T> where
T: Debug,
[src]
T: Debug,
impl<T: ?Sized + Eq + Hash> Deref for InternedHash<T>
[src]
impl<T: ?Sized + Eq + Hash> Display for InternedHash<T> where
T: Display,
[src]
T: Display,
impl<T: ?Sized + Eq + Hash> Eq for InternedHash<T> where
T: Eq,
[src]
T: Eq,
impl<T: ?Sized + Eq + Hash> Hash for InternedHash<T> where
T: Hash,
[src]
T: Hash,
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 + Eq + Hash> Ord for InternedHash<T> where
T: Ord,
[src]
T: Ord,
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: ?Sized + Eq + Hash> PartialEq<InternedHash<T>> for InternedHash<T> where
T: PartialEq,
[src]
T: PartialEq,
impl<T: ?Sized + Eq + Hash> PartialOrd<InternedHash<T>> for InternedHash<T> where
T: PartialOrd,
[src]
T: PartialOrd,
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized + Eq + Hash> Pointer for InternedHash<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for InternedHash<T>
impl<T: ?Sized> Send for InternedHash<T> where
T: Send + Sync,
T: Send + Sync,
impl<T: ?Sized> Sync for InternedHash<T> where
T: Send + Sync,
T: Send + Sync,
impl<T: ?Sized> Unpin for InternedHash<T>
impl<T> !UnwindSafe for InternedHash<T>
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>,