Skip to main content

GarbageCollector

Trait GarbageCollector 

Source
pub trait GarbageCollector: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn can_collect(&self, region: &MemoryRegion) -> bool;
    fn estimate_collection_time(&self, region: &MemoryRegion) -> Duration;
    fn collect(
        &mut self,
        region: &mut MemoryRegion,
        tracker: &mut ReferenceTracker,
    ) -> Result<GCResult, GCError>;
    fn get_statistics(&self) -> GCCollectorStats;
    fn configure(&mut self, config: &GCConfig);
}
Expand description

Garbage collector trait

Required Methods§

Source

fn name(&self) -> &str

Source

fn can_collect(&self, region: &MemoryRegion) -> bool

Source

fn estimate_collection_time(&self, region: &MemoryRegion) -> Duration

Source

fn collect( &mut self, region: &mut MemoryRegion, tracker: &mut ReferenceTracker, ) -> Result<GCResult, GCError>

Source

fn get_statistics(&self) -> GCCollectorStats

Source

fn configure(&mut self, config: &GCConfig)

Implementors§