Skip to main content

walk

Function walk 

Source
pub fn walk<W>(
    walker: &mut W,
    graph: &SchemaGraph,
    ty: &SchemaType,
    value: &SchemaValue,
) -> Result<<W as SchemaWalker>::Output, WalkerError<<W as SchemaWalker>::Error>>
where W: SchemaWalker,
Expand description

Drive a walker over (graph, ty, value).

  • SchemaType::Ref hops are resolved against graph.defs before handing the body to the walker.
  • A reference cycle (the same TypeId re-entered while still on the stack) is reported via WalkerError::RefCycle so walkers do not recurse forever on ill-formed graphs.
  • A dangling reference (the named id is not present in graph.defs) is reported via WalkerError::DanglingRef.
  • Any error produced by the walker itself is bubbled up unchanged via WalkerError::Walker.