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();

Trait Implementations

impl<T: Trace> Drop for Weak<T>

fn drop(&mut self)

impl<T: Trace> Clone for Weak<T>

fn clone(&self) -> Weak<T>

fn clone_from(&mut self, source: &Self)

impl<T: Debug> Debug for Weak<T>

fn fmt(&self, f: &mut Formatter) -> Result

impl<T: Trace> Trace for Weak<T>

fn trace(&mut self, _tracer: &mut Tracer)

impl<T: Trace> CcBoxPtr for Weak<T>

fn data(&self) -> &CcBoxData

unsafe fn drop_value(&mut self)

unsafe fn deallocate(&mut self)

fn color(&self) -> Color

fn buffered(&self) -> bool

fn strong(&self) -> usize

fn inc_strong(&self)

fn dec_strong(&self)

fn weak(&self) -> usize

fn inc_weak(&self)

fn dec_weak(&self)

unsafe fn free(&mut self)