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 moreSource§impl Debug for ExecuteCommandRequest
impl Debug for ExecuteCommandRequest
Source§impl<'de> Deserialize<'de> for ExecuteCommandRequest
impl<'de> Deserialize<'de> for ExecuteCommandRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ExecuteCommandRequest
impl RefUnwindSafe for ExecuteCommandRequest
impl Send for ExecuteCommandRequest
impl Sync for ExecuteCommandRequest
impl Unpin for ExecuteCommandRequest
impl UnsafeUnpin for ExecuteCommandRequest
impl UnwindSafe for ExecuteCommandRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.