Trait moving_gc_arena::HasIx[][src]

pub trait HasIx<T: 'static> {
    fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F)
    where
        F: FnMut(&'b mut Ix<T>)
; }

Trait to expose contained indices to the garbage collector.

Required methods

fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
    F: FnMut(&'b mut Ix<T>), 
[src]

Expose a mutable reference to every Ix owned by this datastructure.

This is used for the collector to know which other elements are pointed to from this element, as well as to update all of the old-generation indices to the new generation.

Avoid panicking in this method. A panic may cause some elements to never be dropped, leaking any owned memory outside the region.

The function f should be called exactly once on each Ix value. With the debug-arena flag on, region mismatches will trigger a panic. In some rare cases, an index itself will be shared between different elements (such as with Rc<Cell<Ix>>). In these situations, care should be taken that each index is exposed only once no matter how many elements are passed over, but this use case is currently not well supported.

Loading content...

Implementations on Foreign Types

impl<T: 'static, S: HasIx<T>> HasIx<T> for Vec<S>[src]

impl<T: 'static, S: HasIx<T>> HasIx<T> for Option<S>[src]

impl<T: 'static, S: HasIx<T>> HasIx<T> for Box<S>[src]

Loading content...

Implementors

impl<T: 'static> HasIx<T> for ()[src]

impl<T: 'static> HasIx<T> for Ix<T>[src]

impl<T: 'static, S1: HasIx<T>, S2: HasIx<T>> HasIx<T> for (S1, S2)[src]

impl<T: 'static, S1: HasIx<T>, S2: HasIx<T>, S3: HasIx<T>> HasIx<T> for (S1, S2, S3)[src]

impl<T: 'static, S1: HasIx<T>, S2: HasIx<T>, S3: HasIx<T>, S4: HasIx<T>> HasIx<T> for (S1, S2, S3, S4)[src]

impl<T: 'static, S: HasIx<T>> HasIx<T> for &mut S[src]

Loading content...