[−][src]Struct darc::Rc
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(&self) -> Self
[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]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,