Struct std::rc::Rc[src]

pub struct Rc<T> {
    // some fields omitted
}

Immutable reference counted pointer type

Methods

impl<T> Rc<T>

fn new<T>(value: T) -> Rc<T>

Construct a new reference-counted box

impl<T> Rc<T>

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

Downgrade the reference-counted pointer to a weak reference

impl<T: Clone> Rc<T>

fn make_unique<T: Clone>(&'a mut self) -> &'a mut T

Acquires a mutable pointer to the inner contents by guaranteeing that the reference count is one (no sharing is possible).

This is also referred to as a copy-on-write operation because the inner data is cloned if the reference count is greater than one.

Trait Implementations

impl<S: Writer, T: Hash<S>> Hash<S> for Rc<T>

fn hash<S: Writer, T: Hash<S>>(&self, state: &mut S)

impl<T> Deref<T> for Rc<T>

fn deref<T>(&'a self) -> &'a T

Borrow the value contained in the reference-counted box

impl<T> Drop for Rc<T>

fn drop<T>(&mut self)

impl<T> Clone for Rc<T>

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

fn clone_from<T>(&mut self, &Rc<T>)

impl<T: PartialEq> PartialEq for Rc<T>

fn eq<T: PartialEq>(&self, other: &Rc<T>) -> bool

fn ne<T: PartialEq>(&self, other: &Rc<T>) -> bool

fn ne<T: PartialEq>(&self, &Rc<T>) -> bool

impl<T: Eq> Eq for Rc<T>

fn assert_receiver_is_total_eq<T: Eq>(&self)

impl<T: PartialOrd> PartialOrd for Rc<T>

fn lt<T: PartialOrd>(&self, other: &Rc<T>) -> bool

fn le<T: PartialOrd>(&self, other: &Rc<T>) -> bool

fn gt<T: PartialOrd>(&self, other: &Rc<T>) -> bool

fn ge<T: PartialOrd>(&self, other: &Rc<T>) -> bool

fn le<T: PartialOrd>(&self, &Rc<T>) -> bool

fn gt<T: PartialOrd>(&self, &Rc<T>) -> bool

fn ge<T: PartialOrd>(&self, &Rc<T>) -> bool

impl<T: Ord> Ord for Rc<T>

fn cmp<T: Ord>(&self, other: &Rc<T>) -> Ordering

impl<T: Show> Show for Rc<T>

fn fmt<T: Show>(&self, f: &mut Formatter) -> Result<(), FormatError>

impl<T> RcBoxPtr<T> for Rc<T>

fn inner<T>(&'a self) -> &'a RcBox<T>

fn strong<T>(&self) -> uint

fn inc_strong<T>(&self)

fn dec_strong<T>(&self)

fn weak<T>(&self) -> uint

fn inc_weak<T>(&self)

fn dec_weak<T>(&self)