pub trait Trace: Sized {
// Provided methods
fn trace(&self, vis: &mut Visitor) { ... }
extern "C" fn trace_(vis: *mut Visitor, this: *const u8) { ... }
fn get_trace_descriptor(this: *const u8) -> TraceDescriptor { ... }
}
Expand description
Trait specifying how the garbage collector processes an object of type T
.
Provided Methods§
Sourcefn trace(&self, vis: &mut Visitor)
fn trace(&self, vis: &mut Visitor)
Function invoking the tracing for an object of type T
.
visitor
: The visitor to dispatch to.
Sourceextern "C" fn trace_(vis: *mut Visitor, this: *const u8)
extern "C" fn trace_(vis: *mut Visitor, this: *const u8)
trace_
method is used for C FFI safety.
Sourcefn get_trace_descriptor(this: *const u8) -> TraceDescriptor
fn get_trace_descriptor(this: *const u8) -> TraceDescriptor
Returns trace descriptor for type that implements this trait. Not recommended to override it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.