Trait zerogc::GcBindHandle[][src]

pub unsafe trait GcBindHandle<'new_gc, T: GcSafe + ?Sized>: GcHandle<T> where
    T: GcRebrand<'new_gc, Self::Id>,
    <T as GcRebrand<'new_gc, Self::Id>>::Branded: GcSafe
{ type Gc: GcRef<'new_gc, <T as GcRebrand<'new_gc, Self::Id>>::Branded>; fn bind_to(
        &self,
        context: &'new_gc <Self::System as GcSystem>::Context
    ) -> Self::Gc; }
Expand description

Trait for binding GcHandles to contexts using GcBindHandle::bind_to

This is separate from the GcHandle trait because Rust doesn’t have Generic Associated Types

TODO: Remove when we get more powerful types

Associated Types

type Gc: GcRef<'new_gc, <T as GcRebrand<'new_gc, Self::Id>>::Branded>[src]

Expand description

The type of the rebranded references

Required methods

fn bind_to(
    &self,
    context: &'new_gc <Self::System as GcSystem>::Context
) -> Self::Gc
[src]

Expand description

Associate this handle with the specified context, allowing its underlying object to be accessed as long as the context is valid.

The underlying object can be accessed just like any other object that would be allocated from the context. It’ll be properly collected and can even be used as a root at the next safepoint.

Implementors