Struct bacon_rajan_cc::Weak
[−]
[src]
pub struct Weak<T: Trace> { // some fields omitted }
A weak version of Cc<T>
.
Weak references do not count when determining if the inner value should be dropped.
See the module level documentation for more.
Methods
impl<T: Trace> Weak<T>
fn upgrade(&self) -> Option<Cc<T>>
Upgrades a weak reference to a strong reference.
Upgrades the Weak<T>
reference to an Cc<T>
, if possible.
Returns None
if there were no strong references and the data was
destroyed.
Examples
use bacon_rajan_cc::Cc; let five = Cc::new(5); let weak_five = five.downgrade(); let strong_five: Option<Cc<_>> = weak_five.upgrade();