[][src]Struct gcmodule::Cc

pub struct Cc<T: ?Sized>(_);

A single-threaded reference-counting pointer that integrates with cyclic garbage collection.

See module level documentation for more details.


impl<T: Trace> Cc<T>[src]

pub fn new(value: T) -> Cc<T>[src]

Constructs a new Cc<T>.

pub fn into_dyn(self) -> Cc<dyn Trace>[src]

Convert to Cc<dyn Trace>.

impl<T: Trace + Clone> Cc<T>[src]

pub fn cow_update(&mut self, update_func: impl FnMut(&mut T))[src]

Update the value T in a copy-on-write way.

If the ref count is 1, the value is updated in-place. Otherwise a new Cc<T> will be created.

impl Cc<dyn Trace>[src]

pub fn downcast_ref<T: 'static>(&self) -> Option<&T>[src]

Attempt to downcast to the specified type.

pub fn downcast<T: Trace>(self) -> Result<Cc<T>, Cc<dyn Trace>>[src]

Attempt to downcast to the specified Cc<T> type.

Trait Implementations

impl<T> Clone for Cc<T>[src]

impl<T: Default + Trace + 'static> Default for Cc<T>[src]

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

type Target = T

The resulting type after dereferencing.

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

impl<T: Eq> Eq for Cc<T>[src]

impl<T: Ord> Ord for Cc<T>[src]

impl<T: PartialEq> PartialEq<Cc<T>> for Cc<T>[src]

impl<T: PartialOrd> PartialOrd<Cc<T>> for Cc<T>[src]

impl<T: Trace> Trace for Cc<T>[src]

impl Trace for Cc<dyn Trace>[src]

impl<T: UnwindSafe + ?Sized> UnwindSafe for Cc<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Cc<T>

impl<T> !Send for Cc<T>

impl<T> !Sync for Cc<T>

impl<T: ?Sized> Unpin for Cc<T>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.