Trait zerogc::TraceImmutable
source · [−]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).