Skip to main content

Module stub

Module stub 

Source
Expand description

Caller-native, typed polydat expression stubs.

Lets Rust code build a polydat binding from an expression and emit it as a Statement for a grammar-safe crate::kernel::subcontext::module::BodyFragment::Statements (subcontext_construction.md §2.1) — without concatenating source strings. The return type is bound at the call site via the Wire trait, so the Rust generic and the polydat target type are one and the same.

Synthesizers (metrics, poll, stop conditions) build stubs; only user-authored predicate text is parsed, once, at the boundary (ExprStub::parse).

Structs§

ExprStub
A caller-native expression stub: a named binding over a polydat expression, optionally type-coerced (via the as cast, polydat_grammar.md §10) and volatile.
GraphMatter
Shape 1 — grammar-safe graph matter: a bundle of statements the polydat kernel compiler turns into a kernel. Built programmatically (typed externs + ExprStub bindings), never from a source string. Feeds PolydatMatter / BodyFragment::Statements.
ScopedExpr
Shape 2 — a polydat expression bound to a parent kernel’s lexical scope. Compiled into a sub-context whose named output is the expression, evaluable many times against injected inputs. The return is whatever Wire type the bound stub was qualified with (ExprStub::returning::<T>), or its natural truthiness (is_true). A general-purpose, scope-bound, callable expression holder.