Skip to main content

SchemaWalker

Trait SchemaWalker 

Source
pub trait SchemaWalker {
    type Output;
    type Error;

    // Required method
    fn walk(
        &mut self,
        graph: &SchemaGraph,
        ty: &SchemaType,
        value: &SchemaValue,
    ) -> Result<Self::Output, Self::Error>;
}
Expand description

Driver-friendly walker over a typed value tree.

Implementations focus on the actual per-shape logic; the top-level walk function handles ref resolution and cycle protection before dispatching back into SchemaWalker::walk on the resolved body.

Required Associated Types§

Source

type Output

The result produced when a value tree is fully consumed.

Source

type Error

The error produced when the walker rejects a sub-tree.

Required Methods§

Source

fn walk( &mut self, graph: &SchemaGraph, ty: &SchemaType, value: &SchemaValue, ) -> Result<Self::Output, Self::Error>

Walk one (sub-)value of a given type in the context of graph.

Implementations may freely call back into walk (the free function in this module) when they recurse into child nodes; that keeps ref resolution centralised.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§