pub struct ExecuteCommandRequest {
pub command: String,
pub working_dir: Option<String>,
pub env: HashMap<String, String>,
pub timeout_secs: Option<u64>,
pub max_output_bytes: Option<u64>,
}Expand description
Request to execute a command.
A misspelled field is refused rather than ignored, and that is a safety
property rather than pedantry. Every optional field on this API either asks
for something safer (timeout_secs, dry_run on the delete route) or
says where to act (working_dir). Serde’s default is to drop a field it
does not recognise, which leaves the less safe default in place and reports
success — a caller who wrote timeoutSecs got no timeout and a
timed_out: false that looked like the command finished within one, and a
caller who wrote workingDir had their command run somewhere else entirely.
The same slip on ?dryRun=true deleted the file it was asked to preview.
The refusal names the offending field and lists the accepted ones, so the caller can fix it from the response alone.
Note for callers coming from spawn-style APIs: command is the whole
command line, and there is no args array. Sending one used to start a
bare shell and report success: true without ever running the command.
Fields§
§command: StringThe command line to execute.
working_dir: Option<String>Optional working directory override.
env: HashMap<String, String>Optional environment variables.
timeout_secs: Option<u64>Timeout in seconds.
max_output_bytes: Option<u64>Cap on the output this response carries, in bytes.
Omitted means the server default. A value above the server’s ceiling is
clamped rather than refused: the caller asked for “as much as possible”,
and total_bytes reports what the command actually produced either way.
Implementations§
Trait Implementations§
Source§impl Clone for ExecuteCommandRequest
impl Clone for ExecuteCommandRequest
Source§fn clone(&self) -> ExecuteCommandRequest
fn clone(&self) -> ExecuteCommandRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more