pub struct SdkOutput {
pub msg_type: String,
pub subtype: Option<String>,
pub session_id: Option<String>,
pub uuid: Option<String>,
pub message: Option<Value>,
pub event: Option<Value>,
pub result: Option<String>,
pub num_turns: Option<u32>,
pub is_error: Option<bool>,
pub errors: Option<Vec<String>>,
pub request_id: Option<String>,
pub request: Option<Value>,
}Expand description
A single NDJSON message received from Claude Code’s stdout.
Uses a flat struct with optional fields rather than a tagged enum so that unknown or new message types are silently tolerated (future-proof).
Fields§
§msg_type: String§subtype: Option<String>§session_id: Option<String>§uuid: Option<String>§message: Option<Value>For assistant messages: the full message object with content array.
event: Option<Value>For stream_event messages: the stream event payload.
result: Option<String>For result messages: the final text result.
num_turns: Option<u32>For result messages: number of API turns taken.
is_error: Option<bool>For result messages: whether an error occurred.
errors: Option<Vec<String>>For result error messages: list of error strings.
request_id: Option<String>For control_request messages: the request ID to echo in responses.
request: Option<Value>For control_request messages: the request payload.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SdkOutput
impl<'de> Deserialize<'de> for SdkOutput
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 SdkOutput
impl RefUnwindSafe for SdkOutput
impl Send for SdkOutput
impl Sync for SdkOutput
impl Unpin for SdkOutput
impl UnsafeUnpin for SdkOutput
impl UnwindSafe for SdkOutput
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.