Expand description
Trait surface that the #[polydat_node] proc-macro
(polydat-derive) calls into for boxing / unboxing wire
values.
§Canonical trait surface (SRD-80b)
Wire—Sized + 'staticRust-type ↔Valuebridge. Owned types only; the macro recognises borrow shapes (&str,&[u8],&[T],&serde_json::Value) syntactically and emits directmatch-on-Valueextraction at the eval call site — no trait dispatch, nounsafelifetime transmute.ConstSource—Sized + 'statictyped-extraction fromConstArgfor ownedConst<T>positions.
Combinator Wire impls cover Option<T> (None-aware
pass-through) and Ext<T> (downcast through
ReflectedValue); ConstSource for Vec<C: ConstSource>
handles workload-list constants.
§Why the trait surface lives here
polydat-derive is a proc-macro crate — it can’t define
traits that are visible at the call site, only emit token
streams referencing traits defined elsewhere. The macro
emits <T as polydat::derive_support::Wire>::extract(...)
and <T as polydat::derive_support::ConstSource>::extract(...)
paths; this module is what those paths resolve to.
Structs§
- Config
- Marker wrapper signalling that the wrapped wire is a
configuration input — expensive to change because the node
keeps internal state (LUTs, alias tables, parsed specs)
derived from it. The macro emits the matching slot with
Port::config()(SRD 15 §“WireCost::Config”) so the compiler warns on cycle-time binding. - Const
- SRD-80 PR B.5 — marker wrapper for const arguments in
#[polydat_node]function signatures. - Dynamic
Outputs - Marker wrapper for node return types whose output port
COUNT is determined at construction time from a
Const<Vec<C>>arg’s length, not at codegen time. SRD-80b shape extension covering nodes likemixed_radixthat emit one output per radix whereradixcount is a workload-supplied list. - Ext
- Operator-side wrapper for adapter-typed wire arguments.
Ext<T>signals “this arg comes fromValue::Ext(Box<dyn ReflectedValue>); downcast it toT.” ImplementsDeref/DerefMutlikeConst<T>so the body can use.method()directly. - Group
Resolver - Splice
dataset_group_open(<source>)upstream when the wire source is aStr(SRD-53DefaultResolver::Group). - Resolved
- SRD-80b in-spirit replacement for the
default_resolverattribute. TheRparameter (aResolverKindimpl) carries the auto-resolver kind; theTparameter is the concreteHandle-inner type the body sees.
Traits§
- Const
Source ConstArg→ typed-Rust-value bridge for owned types inConst<T>position.- Polydat
Setup - SRD-80 PR B.6 — construction-time setup contract for nodes
that derive a pre-computed runtime state from their const
args (e.g.
combinationsparsing a charset pattern into segments + modulus,regex_matchcompiling a pattern,histributionparsing a distribution spec). - Resolver
Kind - Marker trait that names a kind of source-string auto-resolver
for
Resolved<R, T>wire args. The variants here mirrorcrate::dsl::registry::DefaultResolver; each impl picks one of them. - Wire
- Rust-type ↔
Valuebridge.
Functions§
- read_
poly - A polymorphic port’s slots as the owned
Valuethe wire type names: a scalar from its bits, aRef2kind copied out of the pair its producer published. - ref_
value - The value a
Ref2pair at the head ofslotsholds by reference: the one-element slice a JSON, extension, or handle producer published (jit_boundary.md, axiom S7: one dereference). - write_
poly - A polymorphic return written by the node’s resolved output type: a
scalar as its bits into
outputs[0], aRef2kind intoscratch[0]with its pair republished (axiom S3). The value must be of the port’s type: the graph colored the slot by the node’s resolved output type, and a value of another type would be read by every consumer as something it is not, where the interpreter would have carried it. ANonehas no slot form on a compiled engine (engine_parity.md, A12).