Skip to main content

Module input_interface

Module input_interface 

Source
Expand description

Injectable input interface — JSON Schema generation (CLOACI-I-0128).

Canonical home for turning a Rust type into a JSON Schema descriptor and for the InputSlot contract. Lives in cloacina-workflow (not core cloacina) because the #[workflow(params(...))] macro emits calls to these helpers into packaged cdylibs, which depend on cloacina-workflow, not core. Core cloacina re-exports this module.

Spec: [CLOACI-S-0013]; descriptor decision: [CLOACI-A-0007] (JSON Schema via schemars).

Structs§

InputSlot
One declared input slot of an injectable surface: a named, typed value the surface accepts. schema is a JSON Schema fragment (the type descriptor — schemars-derived for Rust, type-hint-derived for Python) that the UI can render a form from and the server can validate an injection against.
SchemaProbe
Opt-in schema derivation for accumulator/reactor boundary types (CLOACI-I-0128 Task D).

Traits§

ProbeFallback
Fallback arm of the probe: selected for any T (one autoref on a &SchemaProbe<T> receiver), yielding a permissive “any” schema. Method resolution prefers ProbeTyped whenever its T: JsonSchema bound holds.
ProbeTyped
Specific arm of the probe: selected when T: JsonSchema (zero autorefs on a &SchemaProbe<T> receiver), yielding the real derived schema.

Functions§

default_json
Serialize a default value to serde_json::Value for an InputSlot::default. Returns None if the value can’t serialize.
schema_for
Generate a JSON Schema for T as a serde_json::Value.
slots_to_json
Serialize a slot list to the JSON array string carried across the FFI descriptor entrypoint (InputInterfaceEntry::slots_json). Falls back to an empty array on serialization failure.