pub unsafe trait GcVisitor: Sized {
    type Err: Debug;
    unsafe fn trace_gc<'gc, T, Id>(
        &mut self,
        gc: &mut Gc<'gc, T, Id>
    ) -> Result<(), Self::Err>
    where
        T: GcSafe<'gc, Id>,
        Id: CollectorId
;
unsafe fn trace_trait_object<'gc, T, Id>(
        &mut self,
        gc: &mut Gc<'gc, T, Id>
    ) -> Result<(), Self::Err>
    where
        T: ?Sized + GcSafe<'gc, Id> + Pointee<Metadata = DynMetadata<T>> + DynTrace<'gc, Id>,
        Id: CollectorId
;
unsafe fn trace_vec<'gc, T, V>(
        &mut self,
        raw: &mut V
    ) -> Result<(), Self::Err>
    where
        T: GcSafe<'gc, V::Id>,
        V: GcRawVec<'gc, T>
;
unsafe fn trace_array<'gc, T, Id>(
        &mut self,
        array: &mut GcArray<'gc, T, Id>
    ) -> Result<(), Self::Err>
    where
        T: GcSafe<'gc, Id>,
        Id: CollectorId
; fn trace<T: Trace + ?Sized>(
        &mut self,
        value: &mut T
    ) -> Result<(), Self::Err> { ... }
fn trace_immutable<T: TraceImmutable + ?Sized>(
        &mut self,
        value: &T
    ) -> Result<(), Self::Err> { ... } }
Expand description

Visits garbage collected objects

This should only be used by a GcSystem

Associated Types

The type of errors returned by this visitor

Required methods

Visit a garbage collected pointer

Safety

Undefined behavior if the GC pointer isn’t properly visited.

Visit a garbage collected trait object.

Safety

The trait object must point to a garbage collected object.

Visit a garbage collected vector.

Safety

Undefined behavior if the vector is invalid.

Visit a garbage collected array.

Safety

Undefined behavior if the array is invalid.

Provided methods

Trace a reference to the specified value

Trace an immutable reference to the specified value

Implementors