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
{ fn bind_to(
        &self,
        context: &'new_gc <Self::System as GcSystem>::Context
    ) -> Gc<'new_gc, <T as GcRebrand<'new_gc, Self::Id>>::Branded, Self::Id>; }
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

Required methods

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