pub struct JsonResponse<T: Serialize> {
pub success: bool,
pub command: String,
pub data: Option<T>,
pub error: Option<String>,
}Expand description
Standard JSON response structure for all commands.
This provides consistent machine-readable output for scripting.
Fields§
§success: boolWhether the command succeeded.
command: StringThe command that was executed.
data: Option<T>The response data (when successful).
error: Option<String>Error message (when failed).
Implementations§
Trait Implementations§
Source§impl<T: Clone + Serialize> Clone for JsonResponse<T>
impl<T: Clone + Serialize> Clone for JsonResponse<T>
Source§fn clone(&self) -> JsonResponse<T>
fn clone(&self) -> JsonResponse<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for JsonResponse<T>where
T: Freeze,
impl<T> RefUnwindSafe for JsonResponse<T>where
T: RefUnwindSafe,
impl<T> Send for JsonResponse<T>where
T: Send,
impl<T> Sync for JsonResponse<T>where
T: Sync,
impl<T> Unpin for JsonResponse<T>where
T: Unpin,
impl<T> UnsafeUnpin for JsonResponse<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for JsonResponse<T>where
T: UnwindSafe,
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