Trait zerogc_context::collector::RawCollectorImpl[][src]

pub unsafe trait RawCollectorImpl: 'static + Sized {
    type GcDynPointer: Copy + Debug + 'static;
    type Ptr: CollectorPtr<Self>;
    type Manager: CollectionManager<Self, Context = Self::RawContext>;
    type RawContext: RawContext<Self>;

    const SINGLETON: bool;
    const SYNC: bool;

    unsafe fn create_dyn_pointer<T: Trace>(t: *mut T) -> Self::GcDynPointer;
fn init(logger: Logger) -> NonNull<Self>;
fn logger(&self) -> &Logger;
fn manager(&self) -> &Self::Manager;
fn should_collect(&self) -> bool;
fn allocated_size(&self) -> MemorySize;
unsafe fn perform_raw_collection(&self, contexts: &[*mut Self::RawContext]); fn id(&self) -> CollectorId<Self> { ... } }
Expand description

A specific implementation of a collector

Associated Types

type GcDynPointer: Copy + Debug + 'static[src]

Expand description

A dynamic pointer to a GC object

The simple collector implements this as a trait object pointer.

type Ptr: CollectorPtr<Self>[src]

Expand description

A pointer to this collector

Must be a ZST if the collector is a singleton.

type Manager: CollectionManager<Self, Context = Self::RawContext>[src]

Expand description

The type that manages this collector’s state

type RawContext: RawContext<Self>[src]

Expand description

The context

Associated Constants

const SINGLETON: bool[src]

Expand description

True if this collector is a singleton

If the collector allows multiple instances, this must be false

const SYNC: bool[src]

Expand description

True if this collector is thread-safe.

Required methods

unsafe fn create_dyn_pointer<T: Trace>(t: *mut T) -> Self::GcDynPointer[src]

Expand description

Convert the specified value into a dyn pointer

fn init(logger: Logger) -> NonNull<Self>[src]

Expand description

Initialize an instance of the collector

Must panic if the collector is not a singleton

fn logger(&self) -> &Logger[src]

Expand description

The logger associated with this collector

fn manager(&self) -> &Self::Manager[src]

fn should_collect(&self) -> bool[src]

fn allocated_size(&self) -> MemorySize[src]

unsafe fn perform_raw_collection(&self, contexts: &[*mut Self::RawContext])[src]

Provided methods

fn id(&self) -> CollectorId<Self>[src]

Expand description

The id of this collector

Implementors