pub trait CommandRequest {
// Required methods
fn into_command(&self) -> Vec<String>;
fn request_base(&self) -> &RequestBase;
fn request_base_mut(&mut self) -> Option<&mut RequestBase>;
}Expand description
Convert a typed CLI request struct into the argv tail the cli binary
should be invoked with. Implementors are the per-leaf request shapes
in the surrounding tree (e.g. agents::spawn::Request) and emit the
flags + positional args their leaf command expects — without the
binary name. Callers prepend whatever launcher prefix they need
(["objectiveai-cli"], ["objectiveai-cli", "instance"], …).
Required Methods§
fn into_command(&self) -> Vec<String>
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".