[][src]Struct scoped_gc::GcScope

pub struct GcScope<'gc> { /* fields omitted */ }

Defines a scope for garbage collection.

It lets you allocate garbage-collected values. They can have cycles. Their reachability is tracked so they can be deallocated once unreachable. All the values are deallocated once the scope is dropped.

Methods

impl<'gc> GcScope<'gc>[src]

pub fn new() -> GcScope<'gc>[src]

pub fn alloc<T: Trace + 'gc>(
    &'gc self,
    value: T
) -> Result<Gc<'gc, T>, GcAllocErr>
[src]

Allocates value in this garbage-collected scope and returns a Gc smart pointer to it.

pub fn collect_garbage(&self)[src]

Trait Implementations

impl<'gc> Debug for GcScope<'gc>[src]

Auto Trait Implementations

impl<'gc> !Sync for GcScope<'gc>

impl<'gc> !Send for GcScope<'gc>

impl<'gc> !Unpin for GcScope<'gc>

impl<'gc> !RefUnwindSafe for GcScope<'gc>

impl<'gc> !UnwindSafe for GcScope<'gc>

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

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

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

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