pub unsafe trait Trace<'v> {
    fn trace(&mut self, tracer: &Tracer<'v>);
}
Expand description

Called by the garbage collection, and must walk over every contained Value in the type. Marked unsafe because if you miss a nested Value, it will probably segfault.

For the most cases #[derive(Trace)] is enough to implement this trait:


#[derive(Trace)]
struct MySet<'v> {
   keys: Vec<Value<'v>>
}

Required methods

Recursively “trace” the value.

Note during trace, Value objects in Self might be already special forward-objects, trying to unpack these values may crash the process.

Generally this function should not do anything except calling trace on the fields.

Implementations on Foreign Types

Implementors