1use crate::GcHandle;
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub struct RootId(pub usize);
6
7pub trait GcRoot {
9 fn scan(&self) -> Vec<GcHandle>;
11
12 fn description(&self) -> String;
14
15 fn estimated_size(&self) -> usize {
17 0
18 }
19
20 fn is_active(&self) -> bool {
22 true
23 }
24}
25
26#[derive(Debug, Clone)]
28pub struct RootInfo {
29 pub id: RootId,
30 pub description: String,
31 pub estimated_size: usize,
32 pub is_active: bool,
33}
34
35#[derive(Debug, Clone)]
37pub struct RootScannerStats {
38 pub registered_roots: usize,
39 pub scans_performed: usize,
40 pub total_roots_found: usize,
41 pub average_roots_per_scan: f64,
42}