tvm_ffi::extra

Module structural_visit

Source
Expand description

Native Rust structural visiting.

Two public layers mirror the C++ API split:

  • Dispatcher + structural_visit — handlers drive recursion through an explicit StructuralVisitorView context. Pass state belongs on the dispatcher; visitor.visit(self, &child) reborrows it for recursive calls. Unmatched values use default child traversal.
  • structural_walk — dispatcher or closure observers steer engine-owned recursion through WalkResult (advance, skip, interrupt).

Both layers thread definition-region state explicitly. Walk handlers opt in with a trailing DefRegionKind; visit handlers read it from their context and may override it for a child through StructuralVisitorView::with_def_region_kind.

Re-exports§

  • pub use super::dispatch::ByWalkDispatch;
  • pub use super::dispatch::DispatchWalker;

Structs§

Enums§

Traits§

Functions§