[][src]Struct gcmodule::RawCc

pub struct RawCc<T: ?Sized, O: AbstractObjectSpace>(_);

Low-level type for Cc<T>.

Methods

impl<T: Trace> RawCc<T, ObjectSpace>[src]

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

Constructs a new Cc<T> in a thread-local storage.

To collect cycles, use collect_thread_cycles.

impl<T: Trace, O: AbstractObjectSpace> RawCc<T, O>[src]

pub fn into_dyn(self) -> RawCc<dyn Trace, O>[src]

Convert to RawCc<dyn Trace>.

impl<T: Trace + Clone> RawCc<T, ObjectSpace>[src]

pub fn update_with(&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<T: ?Sized, O: AbstractObjectSpace> RawCc<T, O>[src]

pub fn trace(&self, tracer: &mut Tracer)[src]

trace without T: Trace bound.

Useful for structures with Cc<T> fields where T does not implement Trace. For example, struct S(Cc<Box<dyn MyTrait>>). To implement Trace for S, it can use Cc::trace(&self.0, tracer).

impl<T: ?Sized> RawCc<T, ThreadedObjectSpace>[src]

pub fn borrow(&self) -> ThreadedCcRef<T>[src]

Immutably borrows the wrapped value.

The borrow lasts until the returned value exits scope.

Trait Implementations

impl<T, O: AbstractObjectSpace> Clone for RawCc<T, O>[src]

impl<T: Debug> Debug for RawCc<T, O>[src]

impl<T: Debug> Display for RawCc<T, O>[src]

impl<T: ?Sized, O: AbstractObjectSpace> Drop for RawCc<T, O>[src]

impl<T: Eq> Eq for RawCc<T, O>[src]

impl<T: Ord> Ord for RawCc<T, O>[src]

impl<T: PartialEq> PartialEq<RawCc<T, ObjectSpace>> for RawCc<T, O>[src]

impl<T: PartialOrd> PartialOrd<RawCc<T, ObjectSpace>> for RawCc<T, O>[src]

Auto Trait Implementations

impl<T, O> !RefUnwindSafe for RawCc<T, O>

impl<T, O> !Send for RawCc<T, O>

impl<T, O> !Sync for RawCc<T, O>

impl<T: ?Sized, O> Unpin for RawCc<T, O>

impl<T, O> !UnwindSafe for RawCc<T, O>

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.