managed_heap/
trace.rs

1use super::address::Address;
2
3use std::iter::Iterator;
4
5pub unsafe trait Traceable {
6    /// Mark all contained Traceable Objects
7    fn mark(&mut self);
8    /// Unmark this Object
9    fn unmark(&mut self);
10    // /// An iterator used for updating the addresses after moving heap content
11    // fn trace(&mut self) -> Box<Iterator<Item = &mut Address>>;
12    /// Checks if self is marked
13    fn is_marked(&self) -> bool;
14}
15
16pub unsafe trait GcRoot<I>
17where
18    I: Traceable + From<Address> + Into<Address>,
19{
20    fn children<'a>(&'a mut self) -> Box<Iterator<Item = &'a mut I> + 'a>;
21}