[][src]Struct zerogc_context::collector::CollectorRef

#[repr(C)]pub struct CollectorRef<C: RawCollectorImpl> { /* fields omitted */ }

A reference to the collector.

TODO: Devise better name

Implementations

impl<C: RawCollectorImpl> CollectorRef<C>[src]

pub fn create() -> Self where
    C::Ptr: CollectorInit<C>, 
[src]

pub fn with_logger(logger: Logger) -> Self where
    C::Ptr: CollectorInit<C>, 
[src]

pub fn as_raw(&self) -> &C[src]

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

The id of this collector

pub fn into_context(self) -> CollectorContext<C>[src]

Convert this collector into a unique context

The single-threaded implementation only allows a single context, so this method is nessicary to support it.

impl<C: SyncCollector> CollectorRef<C>[src]

pub fn create_context(&self) -> CollectorContext<C>[src]

Create a new context bound to this collector

Warning: Only one collector should be created per thread. Doing otherwise can cause deadlocks/panics.

Trait Implementations

impl<C: RawCollectorImpl> Drop for CollectorRef<C>[src]

impl<'gc, 'a, T, C> GcHandleSystem<'gc, 'a, T> for CollectorRef<C> where
    C: RawHandleImpl,
    T: GcSafe + 'gc,
    T: GcErase<'a, CollectorId<C>>,
    T::Erased: GcSafe
[src]

We support handles

type Handle = GcHandle<T::Erased, C>

The type of handles to this object.

impl<C: RawCollectorImpl> GcSystem for CollectorRef<C>[src]

type Id = CollectorId<C>

The type of collector IDs given by this system

type Context = CollectorContext<C>

The type of contexts used in this sytem

impl<C: SyncCollector> Send for CollectorRef<C>[src]

We actually are thread safe ;)

impl<C: SyncCollector> Sync for CollectorRef<C>[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for CollectorRef<C> where
    <C as RawCollectorImpl>::Ptr: RefUnwindSafe
[src]

impl<C> Unpin for CollectorRef<C> where
    <C as RawCollectorImpl>::Ptr: Unpin
[src]

impl<C> UnwindSafe for CollectorRef<C> where
    <C as RawCollectorImpl>::Ptr: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.