Trait hirpdag_hashconsing::ReferenceWeak
source · [−]pub trait ReferenceWeak<D, R> where
D: Hash + Eq + Debug,
R: Reference<D>, {
fn weak_upgrade(ptr: &Self) -> Option<R>;
fn weak_downgrade(ptr: &R) -> Self;
}
Expand description
Weak reference handle type.
For HashconsingRef implementations which support both strong and weak refs.
Required Methods
fn weak_upgrade(ptr: &Self) -> Option<R>
fn weak_upgrade(ptr: &Self) -> Option<R>
Get a strong reference handle from a weak reference handle.
This may fail (returning None) if there is no strong reference in existance.
fn weak_downgrade(ptr: &R) -> Self
fn weak_downgrade(ptr: &R) -> Self
Get a weak reference handle from a strong reference handle.