[−][src]Trait gcmodule::Trace
Defines how the cycle collector should collect a type.
Provided methods
fn trace(&self, tracer: &mut Tracer)
Traverse through values referred by this value.
For example, if self.x
is a value referred by self
,
call self.x.trace(tracer)
.
Do not call the trace
function directly.
fn is_type_tracked(&self) -> bool
Whether this type should be tracked by the cycle collector. This provides an optimization that makes atomic types opt out the cycle collector.
This is ideally an associated constant. However that is currently impossible due to compiler limitations. See https://doc.rust-lang.org/error-index.html#E0038.
fn as_any(&self) -> Option<&dyn Any>
Provide downcast support.
Types that wants downcast support should implement this method like:
fn as_any(&self) -> Option<&dyn std::any::Any> { Some(self) }