pub unsafe trait Trace: Finalize {
// Required methods
unsafe fn trace(&self, tracer: &mut Tracer);
unsafe fn trace_non_roots(&self);
fn run_finalizer(&self);
}
Expand description
The Trace trait, which needs to be implemented on garbage-collected objects.
§Safety
-
An incorrect implementation of the trait can result in heap overflows, data corruption, use-after-free, or Undefined Behaviour in general.
-
Calling any of the functions marked as
unsafe
outside of the context of the garbage collector can result in Undefined Behaviour.
Required Methods§
Sourceunsafe fn trace_non_roots(&self)
unsafe fn trace_non_roots(&self)
Sourcefn run_finalizer(&self)
fn run_finalizer(&self)
Runs Finalize::finalize
on this object and all
contained subobjects.