[][src]Struct darc::Rc

pub struct Rc<T: ?Sized> { /* fields omitted */ }

A reference-counted pointer. 'Rc' stands for 'Reference Counted'.

This may or may not use atomic access for the reference count, depending on whether it is ever converted to an Arc.

Methods

impl<T> Rc<T>[src]

pub fn new(data: T) -> Self[src]

Constructs a new Rc<T>.

This is initially single-threaded, so updates to the reference count will use non-atomic access. If an Arc is ever created from this instance, this will cause all of its references to start using atomic access to the reference count.

pub fn from_arc(arc: Arc<T>) -> Self[src]

Converts an Arc<T> to Rc<T>. This does not change its atomic property.

pub fn unshare(this: &Self) -> bool[src]

Attempts to convert this to an unsynchronized pointer, no longer atomic. Returns true if successful, or false if there are still potentially references on other threads.

Trait Implementations

impl<T: ?Sized> Drop for Rc<T>[src]

impl<T: ?Sized> Clone for Rc<T>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> From<T> for Rc<T>[src]

impl<T: ?Sized> Deref for Rc<T>[src]

type Target = T

The resulting type after dereferencing.

Auto Trait Implementations

impl<T> !Send for Rc<T>

impl<T> !Sync for Rc<T>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]