polydat-derive
The #[polydat_node] procedural macro for
Polydat. It turns one typed free
function into a Polydat node: the node struct, its constructor, the
PolydatNode implementation with the evaluation forms the signature
allows on every engine, and the link-time registration that makes the
function callable from Polydat source.
Most users never depend on this crate directly. The polydat facade
re-exports the attribute as polydat::polydat_node, and the macro
emits paths under polydat::, so a crate that defines nodes depends on
polydat and writes:
/// A rotated-xor checksum of two words.
The function's doc comment becomes the node's description and help.
Each argument is classified by its type: per-cycle wires (scalars,
strings, bytes, JSON, typed vectors, SIMD registers, host types),
Const<T> workload constants captured at construction, &[T] variadic
arguments, and setup state derived once from the constants. A single
return is one output, a tuple is several named outputs, Result runs
once at construction, and Value is polymorphic.
Documentation
The rustdoc on docs.rs lists every argument shape, return shape, and attribute parameter the macro accepts. The embedding guide shows host-defined nodes and value types in a running program.
License
Apache-2.0.