Skip to main content

with_recursion_guard

Function with_recursion_guard 

Source
fn with_recursion_guard<T>(
    seen: &mut BTreeSet<usize>,
    root: &Schema,
    node: &SchemaPieceOrNamed,
    f: impl FnOnce(&mut BTreeSet<usize>) -> Result<T>,
) -> Result<T>
Expand description

Runs f with node marked as on the current resolution path, bailing if it’s already on the path (a cycle). The mark is cleared on exit so sibling reuse of a named type isn’t flagged.