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

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>;

    pub const SINGLETON: bool;
    pub const SYNC: bool;

    pub unsafe fn create_dyn_pointer<T: Trace>(t: *mut T) -> Self::GcDynPointer;
pub fn init(logger: Logger) -> NonNull<Self>;
pub unsafe fn gc_write_barrier<'gc, T: ?Sized, V: ?Sized>(
        owner: &Gc<'gc, T, CollectorId<Self>>,
        value: &Gc<'gc, V, CollectorId<Self>>,
        field_offset: usize
    )
    where
        T: GcSafe + 'gc,
        V: GcSafe + 'gc
;
pub fn logger(&self) -> &Logger;
pub fn manager(&self) -> &Self::Manager;
pub fn should_collect(&self) -> bool;
pub fn allocated_size(&self) -> MemorySize;
pub unsafe fn perform_raw_collection(
        &self,
        contexts: &[*mut Self::RawContext]
    ); pub fn id(&self) -> CollectorId<Self> { ... } }

A specific implementation of a collector

Associated Types

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

A dynamic pointer to a GC object

The simple collector implements this as a trait object pointer.

type Ptr: CollectorPtr<Self>[src]

A pointer to this collector

Must be a ZST if the collector is a singleton.

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

The type that manages this collector's state

type RawContext: RawContext<Self>[src]

The context

Loading content...

Associated Constants

pub const SINGLETON: bool[src]

True if this collector is a singleton

If the collector allows multiple instances, this must be false

pub const SYNC: bool[src]

True if this collector is thread-safe.

Loading content...

Required methods

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

Convert the specified value into a dyn pointer

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

Initialize an instance of the collector

Must panic if the collector is not a singleton

pub unsafe fn gc_write_barrier<'gc, T: ?Sized, V: ?Sized>(
    owner: &Gc<'gc, T, CollectorId<Self>>,
    value: &Gc<'gc, V, CollectorId<Self>>,
    field_offset: usize
) where
    T: GcSafe + 'gc,
    V: GcSafe + 'gc, 
[src]

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

The logger associated with this collector

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

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

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

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

Loading content...

Provided methods

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

The id of this collector

Loading content...

Implementors

Loading content...