pub enum UseArgs {
LegacyPositional(String),
Named(Vec<(String, String, String)>),
}Expand description
v2.8.0 — the closed catalog of use <Tool> argument forms. The
invocation surfaces are mutually exclusive, so a sum type models them
exactly (no ambiguous dual-empty state). NOTE: apply: Tool given: <struct>
(the splat form) is NOT here — it rides StepNode.apply_ref and is
validated against the tool schema in v2.8.0, not parsed as a use.
Variants§
LegacyPositional(String)
use Tool on "${arg}" / use Tool on query — the v2.7.0 single
positional argument. D5 back-compat: behaves byte-identically to the
pre-58 argument: String (empty string when no on clause).
Named(Vec<(String, String, String)>)
use Tool(query = "${q}", max_results = 5) — D2 canonical multi-field
keyword args. Each entry is (name, value, value_kind): value is the
expression STRING (the frontend has no structured Expr; mirrors
argument / parse_argument_list); value_kind is "literal" or
"reference" — the v2.10.0 classification from parse_let_atom, so the
runtime resolves a bare identifier / Step.output as a binding lookup
(like let) instead of passing the name literally. The type-checker
(v2.8.0 + v2.10.0) validates each entry against the tool’s declared input
schema (W2 / CT-2 caller blame) and references against their source.
Implementations§
Source§impl UseArgs
impl UseArgs
Sourcepub fn legacy_argument(&self) -> String
pub fn legacy_argument(&self) -> String
v2.8.0 transitional — the legacy single-arg string for the IR argument
field (still String until v2.8.0 carries structured named args).
Named projects an empty argument here; the type-checker validates
named args from the AST, and v2.8.0 wire their structured dispatch.