[−][src]Trait moving_gc_arena::HasIx
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>),
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.
Implementations on Foreign Types
impl<T: 'static, S: HasIx<T>> HasIx<T> for Vec<S>
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),
impl<T: 'static, S: HasIx<T>> HasIx<T> for Option<S>
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),
impl<T: 'static, S: HasIx<T>> HasIx<T> for Box<S>
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),
Implementors
impl<'_, T: 'static, S: HasIx<T>> HasIx<T> for &'_ mut S
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),
impl<T: 'static> HasIx<T> for ()
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, _f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),
impl<T: 'static> HasIx<T> for Ix<T>
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),
impl<T: 'static, S1: HasIx<T>, S2: HasIx<T>> HasIx<T> for (S1, S2)
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),
impl<T: 'static, S1: HasIx<T>, S2: HasIx<T>, S3: HasIx<T>> HasIx<T> for (S1, S2, S3)
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),
impl<T: 'static, S1: HasIx<T>, S2: HasIx<T>, S3: HasIx<T>, S4: HasIx<T>> HasIx<T> for (S1, S2, S3, S4)
[src]
fn foreach_ix<'b, 'a: 'b, F>(&'a mut self, f: F) where
F: FnMut(&'b mut Ix<T>),
[src]
F: FnMut(&'b mut Ix<T>),