[][src]Trait zerogc::GcBindHandle

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

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

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

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.

Loading content...

Implementors

Loading content...