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

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

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]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

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

We support handles

type Gc = C::Gc

The type of garbag e collected pointers to this object.

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

The type of handles to this object.

fn create_handle(gc: Self::Gc) -> Self::Handle[src]

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

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

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

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

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