[][src]Trait moving_gc_arena::HasIx

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>), 

Expose a mutable reference to every Ix owned by this datastructure. Any Ix which is not exposed by this function will be invalidated by a garbage collection. The object which was pointed to may also have been collected.

If some Ix is owned by two or more instances of this type (such as via Rc<Cell<...>>), then the situation is tricker. Because this is an uncommon use case, and because enforcing uniqueness in the collector would create additional space and time overheads, ensuring uniqueness is a requirement of the implementer.

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

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, S: HasIx<T>> HasIx<T> for &'_ mut S[src]

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]

Loading content...