pub struct GarbageCollector { /* private fields */ }Expand description
Garbage collector with safe handle-based design
Implementations§
Source§impl GarbageCollector
impl GarbageCollector
pub fn new() -> Result<Self>
pub fn with_config(config: GcConfig) -> Result<Self>
Sourcepub fn collect_minor(&self) -> Result<usize>
pub fn collect_minor(&self) -> Result<usize>
Perform minor collection (young generation)
Sourcepub fn collect_major(&self) -> Result<usize>
pub fn collect_major(&self) -> Result<usize>
Perform major collection (all generations)
Sourcepub fn add_root(&self, root: GcPtr<Value>) -> Result<()>
pub fn add_root(&self, root: GcPtr<Value>) -> Result<()>
Add a root to protect an object from collection
Sourcepub fn get_config(&self) -> GcConfig
pub fn get_config(&self) -> GcConfig
Get the current GC configuration
Trait Implementations§
impl Send for GarbageCollector
impl Sync for GarbageCollector
Auto Trait Implementations§
impl !Freeze for GarbageCollector
impl !RefUnwindSafe for GarbageCollector
impl !UnwindSafe for GarbageCollector
impl Unpin for GarbageCollector
impl UnsafeUnpin for GarbageCollector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more