Generated from rustdoc JSON at
dspy-rs v0.7.3 (commit b5da857). Do not edit by hand; regenerate with python3 docs/scripts/gen_api.py (see the script header for the rustdoc commands). Item links lead to full signatures and method docs on docs.rs.Re-exports
| Item | Description |
|---|---|
agent | Re-export of builder::agent. |
AgentLoopNode | Re-export of graph::AgentLoopNode. |
AgentStepOpts | Re-export of step::AgentStepOpts. |
AsNodeName | Re-export of builder::AsNodeName. |
BakeError | Re-export of graph::BakeError. |
Binding | Re-export of graph::Binding. |
Budget | Re-export of interp::Budget. |
BudgetMeter | Re-export of interp::BudgetMeter. |
BudgetPolicy | Re-export of graph::BudgetPolicy. |
build_module_program | Re-export of module_build::build_module_program. |
BuildError | Re-export of builder::BuildError. |
CapSet | Re-export of graph::CapSet. |
carried | Re-export of builder::carried. |
ClassDef | Re-export of crate::typesys::ClassDef. |
code_hash | Re-export of params::code_hash. |
CodeK | Re-export of params::CodeK. |
CodeLang | Re-export of params::CodeLang. |
ConstraintDef | Re-export of sig::ConstraintDef. |
ContextK | Re-export of params::ContextK. |
ContextPolicy | Re-export of params::ContextPolicy. |
cot | Re-export of builder::cot. |
current_overlay | Re-export of bridge::current_overlay. |
default_lm | Re-export of module_build::default_lm. |
DemoRow | Re-export of params::DemoRow. |
Demos | Re-export of params::Demos. |
DsrsFileError | Re-export of text::DsrsFileError. |
EnumDef | Re-export of crate::typesys::EnumDef. |
EnumValueDef | Re-export of crate::typesys::EnumValueDef. |
Exhausted | Re-export of interp::Exhausted. |
extern_hole | Re-export of builder::extern_hole. |
FieldDef | Re-export of sig::FieldDef. |
FieldType | Re-export of crate::typesys::FieldType. |
fork | Re-export of builder::fork. |
ForkJoinNode | Re-export of graph::ForkJoinNode. |
hole | Re-export of builder::hole. |
HoleImpl | Re-export of graph::HoleImpl. |
HoleNode | Re-export of graph::HoleNode. |
HoleReport | Re-export of step::HoleReport. |
HostHoleFn | Re-export of interp::HostHoleFn. |
input_schema_of | Re-export of interp::input_schema_of. |
input | Re-export of builder::input. |
Instruction | Re-export of params::Instruction. |
Interner | Re-export of graph::Interner. |
Interpreter | Re-export of interp::Interpreter. |
KindTag | Re-export of params::KindTag. |
Lineage | Re-export of graph::Lineage. |
lit | Re-export of builder::lit. |
LoadError | Re-export of interp::LoadError. |
loop_ | Re-export of builder::loop_. |
LoopNode | Re-export of graph::LoopNode. |
ModelDef | Re-export of graph::ModelDef. |
ModelId | Re-export of graph::ModelId. |
ModelRefK | Re-export of params::ModelRefK. |
ModuleBuildError | Re-export of module_build::ModuleBuildError. |
ModuleSpec | Re-export of module_build::ModuleSpec. |
ModuleStep | Re-export of module_build::ModuleStep. |
ModuleStepKind | Re-export of module_build::ModuleStepKind. |
Node | Re-export of graph::Node. |
NodeBudget | Re-export of graph::NodeBudget. |
NodeId | Re-export of graph::NodeId. |
NodeSpec | Re-export of builder::NodeSpec. |
out | Re-export of builder::out. |
Overlay | Re-export of params::Overlay. |
OverlayError | Re-export of params::OverlayError. |
ParamId | Re-export of params::ParamId. |
ParamKind | Re-export of params::ParamKind. |
ParamOwner | Re-export of params::ParamOwner. |
ParamSlot | Re-export of params::ParamSlot. |
ParamValue | Re-export of params::ParamValue. |
ParseError | Re-export of text::ParseError. |
Port | Re-export of builder::Port. |
PortRef | Re-export of graph::PortRef. |
PortSpec | Re-export of module_build::PortSpec. |
predict | Re-export of builder::predict. |
PredictNode | Re-export of graph::PredictNode. |
Program | Re-export of graph::Program. |
ProgramBuilder | Re-export of builder::ProgramBuilder. |
ProgramMeta | Re-export of graph::ProgramMeta. |
refine | Re-export of builder::refine. |
RefineNode | Re-export of graph::RefineNode. |
RenderSpec | Re-export of sig::RenderSpec. |
retry | Re-export of builder::retry. |
RetryNode | Re-export of graph::RetryNode. |
route | Re-export of builder::route. |
RouteNode | Re-export of graph::RouteNode. |
RunError | Re-export of interp::RunError. |
RuntimeEnv | Re-export of interp::RuntimeEnv. |
seq | Re-export of builder::seq. |
SeqNode | Re-export of graph::SeqNode. |
SigError | Re-export of sig::SigError. |
SigId | Re-export of graph::SigId. |
SigMismatch | Re-export of sig::SigMismatch. |
SignatureBuilder | Re-export of sig::SignatureBuilder. |
SignatureDef | Re-export of sig::SignatureDef. |
Slot | Re-export of params::Slot. |
StepDef | Re-export of step::StepDef. |
StepKind | Re-export of step::StepKind. |
StopSpec | Re-export of graph::StopSpec. |
Sym | Re-export of graph::Sym. |
ToolDef | Re-export of graph::ToolDef. |
ToolDesc | Re-export of params::ToolDesc. |
ToolId | Re-export of graph::ToolId. |
ToolKind | Re-export of graph::ToolKind. |
ToolStepDef | Re-export of step::ToolStepDef. |
TypeTable | Re-export of crate::typesys::TypeTable. |
unbound_model_config | Re-export of module_build::unbound_model_config. |
ValidateError | Re-export of validate::ValidateError. |
with_ambient_overlay | Re-export of bridge::with_ambient_overlay. |
with_overlay | Re-export of bridge::with_overlay. |
Modules
| Item | Description |
|---|---|
bridge | The fx/ModuleState ↔ Overlay bridge (RFC 0002 §2.4 migration contract). |
builder | The Rust builder frontend (RFC 0002 §4.3–4.4): constructs the same runtime Program value the text parser will. |
graph | The IR graph core (RFC 0002 §2): entity ids, the Interner, the closed Node enum, field-level Binding/PortRef dataflow, and Program — arenas over value-level signatures. |
interp | The IR interpreter (RFC 0002 §3): async evaluation of a loaded Program. |
module_build | RFC 0003 stage M-3 library support: the module “linker”. |
params | Parameters (RFC 0002 §2.4): every mutable thing is a named, addressable slot; a candidate is an Overlay read through at render time, never a mutation. |
sig | Value-level signatures (RFC 0002 §1) — SignatureDef and friends. |
step | RFC 0003 stage M-2: step metadata. |
text | The .dsrs text format (RFC 0002 §4, stage IR-5). |
validate | Load-time validation (RFC 0002 §2.3): builder finish(), the loader, and Program::validate() run the same code path. Nothing is checked lazily at call time. |
ir::sig
Value-level signatures (RFC 0002 §1) — SignatureDef and friends.
Structs
| Item | Description |
|---|---|
ConstraintDef | Owned runtime form of ConstraintSpec (which stays &'static for the derive). |
FieldDef | One input or output field of a SignatureDef. |
SigMismatch | Structural mismatch reported by SignatureDef::matches. |
SignatureBuilder | Builder for SignatureDef; validation happens at finish. |
SignatureDef | A signature as an owned value: what the derive macro knows at compile time, available at runtime with no 'static requirement (RFC 0002 §1.1). |
Enums
| Item | Description |
|---|---|
RenderSpec | Owned runtime form of InputRenderSpec. |
SigError | Validation failure from SignatureBuilder::finish. What the derive macro rejects, this rejects — same closed subset in both lanes (RFC 0002 §1.3). |
ir::bridge
The fx/ModuleState ↔ Overlay bridge (RFC 0002 §2.4 migration contract).
Functions
| Item | Description |
|---|---|
current_overlay | The ambient overlay, if a with_ambient_overlay scope is active on this task. Read by #module-generated executable fns immediately before Interpreter::run. |
with_ambient_overlay | Runs fut with overlay as the ambient candidate for every #module fn called on this task — the interpreter-lane sibling of fx::with_params. |
with_overlay | Runs fut with overlay (unbound against program) as the ambient fx::Params scope — the fx-lane equivalent of passing the overlay to Interpreter::run. |
ir::builder
The Rust builder frontend (RFC 0002 §4.3–4.4): constructs the same runtime Program value the text parser will.
Structs
| Item | Description |
|---|---|
NodeSpec | An unregistered node: the builder-side mirror of Node with name-based ports and inline children. |
ProgramBuilder | Builds a Program. Declarations (caps, models, sigs, tools) accumulate; main lowers the node tree, materializes param slots, seals the hash, and validates. |
Enums
| Item | Description |
|---|---|
BuildError | |
Port | A name-based port, resolved to a PortRef at main(). |
Traits
| Item | Description |
|---|---|
AsNodeName | Anything that names a node: a string, or a leaf/step spec. |
Functions
| Item | Description |
|---|---|
agent | The LLM+tool loop. |
carried | ^field — the previous iteration’s carried value (Loop bodies only). |
cot | Chain-of-thought sugar: a Predict over sig.augmented_with(reasoning). |
extern_hole | An extern (host-backed) typed hole (RFC 0003 §4): a native fn bound by leaf name from the runtime environment at load. |
fork | Concurrent branches, joined all-success / fail-fast. |
hole | A typed hole: sandboxed JS with a declared signature and capability set. |
input | $.field — the enclosing scope’s input. |
lit | A JSON literal port. |
loop_ | Bounded loop. |
out | node.field — an earlier node’s output. node accepts a name string or a leaf spec (anything AsNodeName). |
predict | One LM call over sig. |
refine | Judge-gated refinement of a child. |
retry | Bounded retry of a child. |
route | Enum-discriminated branching. |
seq | Sequential composition. |
ir::graph
The IR graph core (RFC 0002 §2): entity ids, the Interner, the closed Node enum, field-level Binding/PortRef dataflow, and Program — arenas over value-level signatures.
Structs
| Item | Description |
|---|---|
AgentLoopNode | The LLM+tool loop as the first-class unit. |
Binding | One field-level wire: dst input field (or exported name) fed from src. |
CapSet | Capability names: namespaced, colon-separated ("net:search", "fs:read"). BTreeSet: set ops happen at load only, never on the hot path. |
ForkJoinNode | |
HoleNode | LACUNA-style typed hole: opaque-but-typed code. The optimizer sees a signature (and, when sandboxed, a Code gene); the type system sees a normal node. |
Interner | Graph-side string interner. Signatures speak strings (SignatureDef is constructible with zero context); the graph speaks Syms. |
Lineage | |
LoopNode | |
ModelDef | LMConfig is already serde with api_key #serde(skip) — reused verbatim: model entries carry provider/URL/sampling only, never secrets. |
ModelId | Model reference id. Distinct from the trace format’s per-trace trace::ModelId — this one indexes Program::models. |
NodeBudget | |
NodeId | |
PredictNode | One LM call. No tools. cot in the surface syntax lowers to a Predict over sig.augmented_with(reasoning). |
Program | A loaded IR program: arenas + interner + capability ceiling. |
ProgramMeta | |
RefineNode | |
RetryNode | |
RouteNode | |
SeqNode | |
SigId | |
StopSpec | |
Sym | Interned string: node names, field references in bindings, tool names. |
ToolDef | |
ToolId |
Enums
ir::interp
The IR interpreter (RFC 0002 §3): async evaluation of a loaded Program.
Structs
| Item | Description |
|---|---|
Budget | Run-level spend limits. None = unlimited. |
BudgetMeter | Check-before-call metering: calls and deadline are hard-gated pre-call; token budgets are soft (checked against accumulated usage, since usage is only known post-hoc). |
Exhausted | Budget reservation failure. |
Interpreter | A loaded, executable program: validated graph + bound models/tools + registered sandbox code. Cheap to share; run state never lives here. |
RuntimeEnv | What the host supplies at load: live models, host tool bindings, the sandbox, and the capability grants. |
Enums
Functions
| Item | Description |
|---|---|
input_schema_of | Projects a tool/hole signature’s input side to a JSON Schema object — the declared interface is the schema the model sees. |
Type aliases
| Item | Description |
|---|---|
HostHoleFn | A native extern-hole implementation: resolved input map in, JSON value out (coerced against the hole’s output signature by the interpreter). |
ir::module_build
RFC 0003 stage M-3 library support: the module “linker”.
Structs
| Item | Description |
|---|---|
ModuleSpec | The parsed shape of a #module fn body. |
ModuleStep |
Enums
| Item | Description |
|---|---|
ModuleBuildError | Why a #module body could not be linked into a program. |
ModuleStepKind | |
PortSpec | A macro-emitted port: name-based, resolved by the linker. |
Functions
| Item | Description |
|---|---|
build_module_program | Links a ModuleSpec into a validated Program. Deterministic: the same spec produces the same canonical text and therefore the same program hash. |
default_lm | The globally-configured LM (configure), used by generated module code to bind the default model ref at load. |
unbound_model_config | The placeholder config a module program declares for model ref name. Loading it unbound fails loudly; the real client arrives by name through RuntimeEnv::bind_model. |
ir::params
Parameters (RFC 0002 §2.4): every mutable thing is a named, addressable slot; a candidate is an Overlay read through at render time, never a mutation.
Structs
| Item | Description |
|---|---|
ContextPolicy | The open-lane optimizable slot (vision §6.6). Minimal v1; additive later. |
DemoRow | One few-shot demonstration row: input and output field maps. |
Overlay | A candidate = dense data overlay over a fixed skeleton. Clone is a vec clone. |
ParamId | |
ParamSlot | One optimizable slot: canonical path, owner, kind, and the incumbent value. |
Slot | Typed slot handle: optimizer-side mutation mistakes are compile errors. |
Enums
Traits
| Item | Description |
|---|---|
KindTag |
Functions
| Item | Description |
|---|---|
code_hash | Stable content hash of a code gene’s source. |
ir::step
RFC 0003 stage M-2: step metadata.
Structs
| Item | Description |
|---|---|
AgentStepOpts | #agent(...) attribute options, mirroring the AgentLoopNode surface. |
HoleReport | One hole-ized expression in a #module body (RFC 0003 §6) — the opacity report entry. |
StepDef | One step declaration — what a #predict/#cot/#agent fn is, as data. |
ToolStepDef | One #tool declaration: metadata plus the host implementation. |
Enums
| Item | Description |
|---|---|
StepKind |
ir::text
The .dsrs text format (RFC 0002 §4, stage IR-5).
Structs
| Item | Description |
|---|---|
ParseError | A parse failure with the source position and what was expected — designed to be actionable feedback for a model regenerating the program. |
Enums
| Item | Description |
|---|---|
DsrsFileError | Failure loading or saving a .dsrs artifact file. |
ir::validate
Load-time validation (RFC 0002 §2.3): builder finish(), the loader, and Program::validate() run the same code path. Nothing is checked lazily at call time.
Enums
| Item | Description |
|---|---|
ValidateError |
