Skip to main content

Crate prosaic_common

Crate prosaic_common 

Source
Expand description

Shared type metadata for the prosaic template engine.

Owns ValueType, the PIPE_SPECS registry, and const-eval helpers used by both prosaic-core (at runtime) and prosaic-derive (at macro expansion time). This crate is no_std and has no dependencies so it can be included anywhere the other two crates run.

Structs§

PipeSpec
The type contract of a named pipe: the ValueType of its input value and the ValueType of its output.

Enums§

ValueType
A linguistic type that a template slot or pipe can carry.

Constants§

PIPE_SPECS
The complete set of pipes recognised by the Prosaic engine.

Functions§

pipe_spec
Look up a pipe by name. const fn so it is usable inside const _: () = { ... } assertion blocks emitted by the prosaic_template! macro.
schema_lookup
Look up a slot’s declared ValueType in a HasProsaicSchema-style schema slice. const fn so it is usable inside compile-time assertion blocks emitted by the prosaic_template! macro.
types_compatible
Returns true when a value of type actual can satisfy a slot or pipe that expects type expected. ValueType::Any is compatible with every concrete type in either direction; concrete types are compatible only with themselves.