Struct alloc::rc::Rc[src]

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

Immutable reference counted pointer type

Methods

impl<T> Rc<T>

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

Construct a new reference-counted box

impl<T> Rc<T>

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

Downgrade the reference-counted pointer to a weak reference

impl<T: Clone> Rc<T>

fn make_unique<'a>(&'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<T> Deref<T> for Rc<T>

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

Borrow the value contained in the reference-counted box

impl<T> Drop for Rc<T>

fn drop(&mut self)

impl<T> Clone for Rc<T>

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

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

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

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

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

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

fn assert_receiver_is_total_eq(&self)

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

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

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

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

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

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

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

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

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