pub struct CommandResponse {
pub success: bool,
pub action: Option<String>,
pub message: Option<String>,
pub value: Option<Value>,
pub state: Option<Value>,
pub error: Option<String>,
pub extra: Map<String, Value>,
}Expand description
The common response envelope every box command endpoint returns:
{"success": bool, "action": ..., "message": ..., "value": ..., "state": ...}.
Fields§
§success: boolWhether the box executed the command.
action: Option<String>Echo of the action that ran.
message: Option<String>Human-readable result message (what the CLI prints).
value: Option<Value>Structured result value, shape depends on the action.
state: Option<Value>Structured state object (supply/battery state, usb port state).
error: Option<String>Error message when success is false.
extra: Map<String, Value>Any endpoint-specific extra fields (e.g. SPI’s top-level word_size).
Trait Implementations§
Source§impl Clone for CommandResponse
impl Clone for CommandResponse
Source§fn clone(&self) -> CommandResponse
fn clone(&self) -> CommandResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandResponse
impl Debug for CommandResponse
Source§impl<'de> Deserialize<'de> for CommandResponse
impl<'de> Deserialize<'de> for CommandResponse
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CommandResponse
impl RefUnwindSafe for CommandResponse
impl Send for CommandResponse
impl Sync for CommandResponse
impl Unpin for CommandResponse
impl UnsafeUnpin for CommandResponse
impl UnwindSafe for CommandResponse
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
Mutably borrows from an owned value. Read more