pub unsafe trait TraceImmutable: Trace {
    fn trace_immutable<V: GcVisitor>(
        &self,
        visitor: &mut V
    ) -> Result<(), V::Err>; }
Expand description

A type that can be safely traced/relocated without having to use a mutable reference

Types with interior mutability (like RefCell or Cell<Gc<T>>) can safely implement this, since they allow safely relocating the pointer without a mutable reference. Likewise primitives (with new garbage collected data) can also implement this (since they have nothing to trace).

Required methods

Trace an immutable reference to this type

The visitor may want to relocate garbage collected pointers, so any Gc pointers must be behind interior mutability.

Implementations on Foreign Types

Implementors