pub struct RawCc<T: ?Sized, O: AbstractObjectSpace>(/* private fields */);Expand description
Low-level type for Cc<T>.
Implementations§
Source§impl<T: Trace> RawCc<T, ObjectSpace>
impl<T: Trace> RawCc<T, ObjectSpace>
Sourcepub fn new(value: T) -> Cc<T>
pub fn new(value: T) -> Cc<T>
Constructs a new Cc<T> in a thread-local storage.
To collect cycles, use collect_thread_cycles.
Source§impl<T: Trace + Clone> RawCc<T, ObjectSpace>
impl<T: Trace + Clone> RawCc<T, ObjectSpace>
Sourcepub fn update_with(&mut self, update_func: impl FnMut(&mut T))
pub fn update_with(&mut self, update_func: impl FnMut(&mut T))
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.
Source§impl<T: ?Sized> RawCc<T, ThreadedObjectSpace>
impl<T: ?Sized> RawCc<T, ThreadedObjectSpace>
Sourcepub fn borrow(&self) -> ThreadedCcRef<'_, T>
pub fn borrow(&self) -> ThreadedCcRef<'_, T>
Immutably borrows the wrapped value.
The borrow lasts until the returned value exits scope.
Trait Implementations§
impl<T: Eq> Eq for RawCc<T, ObjectSpace>
Source§impl<T: Ord> Ord for RawCc<T, ObjectSpace>
impl<T: Ord> Ord for RawCc<T, ObjectSpace>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
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, O> !UnwindSafe for RawCc<T, O>
impl<T, O> Freeze for RawCc<T, O>where
T: ?Sized,
impl<T, O> Unpin for RawCc<T, O>where
T: ?Sized,
impl<T, O> UnsafeUnpin for RawCc<T, O>where
T: ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more