pub struct GarbageCollector { /* private fields */ }Implementations§
Source§impl GarbageCollector
impl GarbageCollector
pub fn new(heap: MemoryHeap) -> Self
pub fn with_strategy(self, strategy: GCStrategy) -> Self
pub fn with_threshold(self, threshold: MemorySize) -> Self
pub fn allocate(&mut self, value: Value) -> ObjectId
pub fn add_root(&mut self, object_id: ObjectId)
pub fn remove_root(&mut self, object_id: ObjectId)
pub fn get(&self, object_id: ObjectId) -> Option<&Value>
pub fn get_mut(&mut self, object_id: ObjectId) -> Option<&mut Value>
pub fn collect(&mut self) -> GCStats
pub fn stats(&self) -> &GCStats
pub fn heap(&self) -> &MemoryHeap
pub fn heap_mut(&mut self) -> &mut MemoryHeap
pub fn is_marked(&self, object_id: ObjectId) -> bool
pub fn allocated_bytes(&self) -> MemorySize
pub fn set_threshold(&mut self, threshold: MemorySize)
pub fn force_collect(&mut self) -> GCStats
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GarbageCollector
impl RefUnwindSafe for GarbageCollector
impl Send for GarbageCollector
impl Sync for GarbageCollector
impl Unpin for GarbageCollector
impl UnwindSafe 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