Skip to main content

GcObject

Trait GcObject 

Source
pub trait GcObject: Any {
    // Required method
    fn trace(&self, visit: &mut dyn FnMut(GcId));

    // Provided method
    fn on_free(&mut self, _rt: &mut GcRuntime) { ... }
}
Expand description

Trait for objects stored in the GC heap. Implementors expose graph edges via trace.

Required Methods§

Source

fn trace(&self, visit: &mut dyn FnMut(GcId))

Provided Methods§

Source

fn on_free(&mut self, _rt: &mut GcRuntime)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§