pub trait CommandRequest {
// Required methods
fn request_base(&self) -> &RequestBase;
fn request_base_mut(&mut self) -> Option<&mut RequestBase>;
}Expand description
Common accessors shared by the per-leaf typed CLI request shapes in the
surrounding tree (e.g. agents::spawn::Request): the flattened
RequestBase envelope every leaf embeds.
Lowering a request to an argv tail no longer lives here — requests are
dispatched to the cli as JSON via its top-level --request flag, so the
SDK serializes the typed request directly rather than building argv.
Required Methods§
Sourcefn request_base(&self) -> &RequestBase
fn request_base(&self) -> &RequestBase
The request’s flattened RequestBase envelope (jq /
python / timeout / max_tokens). Every leaf embeds one,
so the implementation is &self.base.
Sourcefn request_base_mut(&mut self) -> Option<&mut RequestBase>
fn request_base_mut(&mut self) -> Option<&mut RequestBase>
Mutable access to the request’s flattened RequestBase
envelope, when it has one (Some(&mut self.base)). Lets a
caller inject the envelope controls (e.g. timeout /
max_tokens) onto an already-parsed request in place, without
re-serializing it through argv — used by the MCP server.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".