[][src]Trait moving_gc_arena::traverse::Strategy

pub trait Strategy<T: 'static, State> {
    pub fn run<'a, F, V>(
        &self,
        get_next: &mut F,
        visitor: &mut V,
        start: Entry<'_, T>
    )
    where
        F: FnMut(Ix<T>) -> Option<Entry<'a, T>>,
        V: Visitor<T, State>
; }

A Strategy allows for controlling the method and order for mark-based traversals.

While for a standard depth-first-search, the CallStack strategy is sufficient, this is vulnerable to stack overflows, and does not allow traversals in anything other than the order given by HasIx::foreach_ix

Required methods

pub fn run<'a, F, V>(
    &self,
    get_next: &mut F,
    visitor: &mut V,
    start: Entry<'_, T>
) where
    F: FnMut(Ix<T>) -> Option<Entry<'a, T>>,
    V: Visitor<T, State>, 
[src]

Runs the traversal for a given starting point and function to get next entries by index. Should visit a corresponding state of the visitor for each entry.

This should run the entire traversal. The state needed for that may be stored in any way possible.

Loading content...

Implementors

impl<T: 'static + HasIx<T>> Strategy<T, PreAndPost> for CallStack[src]

impl<T: 'static + HasIx<T>> Strategy<T, PreOnly> for CallStack[src]

impl<T: 'static + HasIx<T>, St, Str: Strategy<T, St>, '_> Strategy<T, St> for &'_ Str[src]

Loading content...