[−][src]Trait moving_gc_arena::HasIx
Trait to expose contained indices to the garbage collector.
Required methods
pub 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>),
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.
Likewise, avoid modifying the set of indices in this function. Failure to do so may cause later methods relying on the consistency of this method to panic, or possibly leak.
Implementations on Foreign Types
impl<T: 'static, S: HasIx<T>> HasIx<T> for Vec<S>
[src]
pub 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]
pub 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]
pub 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> HasIx<T> for ()
[src]
pub 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]
pub 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]
pub 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]
pub 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]
pub 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 &'_ mut S
[src]
pub 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>),