pub struct SchemaProbe<T>(/* private fields */);Expand description
Opt-in schema derivation for accumulator/reactor boundary types (CLOACI-I-0128 Task D).
Unlike workflow params (whose types we control via #[workflow(params(...))]),
computation-graph boundary types are defined in the author’s crate and may
or may not derive schemars::JsonSchema. We do NOT want to force the derive
— so the #[computation_graph] macro can’t unconditionally call
schema_for (that needs the bound at compile time).
Instead the macro emits a probe over SchemaProbe<T> that, via autoref
specialization (the stable-Rust dtolnay pattern), resolves to the real
schema when T: JsonSchema and to a permissive {} (“any”) schema otherwise.
Authors opt a boundary type into rich typing simply by adding
#[derive(schemars::JsonSchema)]; types without it degrade to name-only slots
rather than failing to compile.
§Usage (what the macro emits)
{
use ::cloacina_workflow::input_interface::{ProbeTyped as _, ProbeFallback as _};
(&::cloacina_workflow::input_interface::SchemaProbe::<MyType>::new())
.probe_input_schema()
}