Expand description
A Cell
pointing to a garbage collected object.
This only supports mutating NullTrace
types,
becuase garbage collected pointers need write barriers.
Implementations
sourceimpl<T: Trace + Copy> GcCell<T>
impl<T: Trace + Copy> GcCell<T>
Trait Implementations
sourceimpl<'gc, OwningRef, Value> GcDirectBarrier<'gc, OwningRef> for GcCell<Value> where
Value: GcDirectBarrier<'gc, OwningRef> + Copy,
impl<'gc, OwningRef, Value> GcDirectBarrier<'gc, OwningRef> for GcCell<Value> where
Value: GcDirectBarrier<'gc, OwningRef> + Copy,
sourceunsafe fn write_barrier(&self, owner: &OwningRef, field_offset: usize)
unsafe fn write_barrier(&self, owner: &OwningRef, field_offset: usize)
Trigger a write barrier, before writing to one of the owning object’s managed fields Read more
sourceimpl<'new_gc, T: Trace + Copy, Id: CollectorId> GcRebrand<'new_gc, Id> for GcCell<T> where
T: Trace + Copy + GcRebrand<'new_gc, Id>,
Id: CollectorId,
T::Branded: Copy + Trace,
impl<'new_gc, T: Trace + Copy, Id: CollectorId> GcRebrand<'new_gc, Id> for GcCell<T> where
T: Trace + Copy + GcRebrand<'new_gc, Id>,
Id: CollectorId,
T::Branded: Copy + Trace,
sourceimpl<'gc, T: Trace + Copy, Id: CollectorId> GcSafe<'gc, Id> for GcCell<T> where
T: GcSafe<'gc, Id> + Copy,
impl<'gc, T: Trace + Copy, Id: CollectorId> GcSafe<'gc, Id> for GcCell<T> where
T: GcSafe<'gc, Id> + Copy,
sourceimpl<T: Trace + Copy> Trace for GcCell<T> where
T: Trace + Copy,
impl<T: Trace + Copy> Trace for GcCell<T> where
T: Trace + Copy,
sourceconst NEEDS_TRACE: bool
const NEEDS_TRACE: bool
Whether this type needs to be traced by the garbage collector. Read more
sourceconst NEEDS_DROP: bool
const NEEDS_DROP: bool
If this type needs a destructor run. Read more
impl<T: Trace + Copy> NullTrace for GcCell<T> where
T: Copy + NullTrace,
impl<T: Trace + Copy> TrustedDrop for GcCell<T> where
T: TrustedDrop,
Auto Trait Implementations
impl<T> !RefUnwindSafe for GcCell<T>
impl<T> Send for GcCell<T> where
T: Send,
impl<T> !Sync for GcCell<T>
impl<T> Unpin for GcCell<T> where
T: Unpin,
impl<T> UnwindSafe for GcCell<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more