Skip to main content

Collector

Trait Collector 

Source
pub trait Collector: Send + Sync {
    // Required methods
    fn register<T>(&self, data: Arc<T>)
       where T: ?Sized + Send + Sync + 'static,
             Arc<T>: StrongCount;
    fn remove<T>(&self, data: &Arc<T>)
       where T: ?Sized + Send + Sync + 'static,
             Arc<T>: StrongCount;
}
Expand description

A trait which describes a garbage collector which collects resources dropped on a realtime thread and safely deallocates them on another thread.

Required Methods§

Source

fn register<T>(&self, data: Arc<T>)
where T: ?Sized + Send + Sync + 'static, Arc<T>: StrongCount,

Register this data with the garbage collector.

Source

fn remove<T>(&self, data: &Arc<T>)
where T: ?Sized + Send + Sync + 'static, Arc<T>: StrongCount,

Called in ArcGc’s Drop implementation.

This can be used to indicate that garbage-collected items should be checked for pruning.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§