Trait mjb_gc::Trace [−][src]
pub unsafe trait Trace { unsafe fn untrace(&self); unsafe fn trace(&self); unsafe fn set_undone(&self); fn counts_match(&self) -> bool; fn could_contain_cycles() -> bool { ... } }
Expand description
A trait for tracing through Gc
ed values.
Safety
All accessible contained Gc
s must be traced.
could_contain_cycles()
must return true
if the type could
contain cycles.
Required methods
Resets all inner Gc
s for another trace cycle.
Internally, this resets the recorded reference count from inside the loop.
Safety
This function should not be used outside of Trace
’s implementation.
This function traces through each inner Gc
.
Internally, records a reference count from inside the loop.
Safety
This function should not be used outside of Trace
’s implementation.
unsafe fn set_undone(&self)
unsafe fn set_undone(&self)
This function resets the done
flag on a Gc
.
Safety
This function should not be used outside of Trace
’s implementation.
fn counts_match(&self) -> bool
fn counts_match(&self) -> bool
Whether all the counts match, meaning there is no external references to the set.
If there are no children, this function should return true
.
This must still be called on all inner Gc
s, even once one returns
false. This can still be done in a single expression for most types
by using &
rather than &&
.
Provided methods
fn could_contain_cycles() -> bool
fn could_contain_cycles() -> bool
Whether the type could contain cycles.