pub struct SdkResponse {
pub command: String,
pub success: bool,
pub id: Option<String>,
pub error: Option<String>,
pub data: Option<Value>,
/* private fields */
}Expand description
A structured SDK/RPC response.
Serialises to the standard JSONL response envelope:
{"type":"response","command":"prompt","success":true,"id":"42"}For errors:
{"type":"response","command":"set_model","success":false,"error":"..."}For success with data:
{"type":"response","command":"session_info","success":true,"data":{...}}Fields§
§command: StringThe command name this response correlates to.
success: boolWhether the command succeeded.
id: Option<String>Optional correlation id matching the command’s id.
error: Option<String>Error message (only when success is false).
data: Option<Value>Response data payload (only when success is true).
Implementations§
Source§impl SdkResponse
impl SdkResponse
Trait Implementations§
Source§impl Clone for SdkResponse
impl Clone for SdkResponse
Source§fn clone(&self) -> SdkResponse
fn clone(&self) -> SdkResponse
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 SdkResponse
impl Debug for SdkResponse
Source§impl<'de> Deserialize<'de> for SdkResponse
impl<'de> Deserialize<'de> for SdkResponse
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 SdkResponse
impl RefUnwindSafe for SdkResponse
impl Send for SdkResponse
impl Sync for SdkResponse
impl Unpin for SdkResponse
impl UnsafeUnpin for SdkResponse
impl UnwindSafe for SdkResponse
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