Skip to main content

GcRoot

Trait GcRoot 

Source
pub trait GcRoot {
    // Required methods
    fn scan(&self) -> Vec<GcHandle>;
    fn description(&self) -> String;

    // Provided methods
    fn estimated_size(&self) -> usize { ... }
    fn is_active(&self) -> bool { ... }
}
Expand description

Source of GC handles that must be treated as roots during collection.

Required Methods§

Source

fn scan(&self) -> Vec<GcHandle>

Scan this root source and return all reachable GC handles.

Source

fn description(&self) -> String

Get a human-readable description of this root source.

Provided Methods§

Source

fn estimated_size(&self) -> usize

Get the estimated size of values reachable from this root source.

Source

fn is_active(&self) -> bool

Check if this root source is still active.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§