pub struct ClaudeCliOutput {
pub result: Option<String>,
pub is_error: bool,
pub duration_ms: u64,
pub num_turns: u64,
pub stop_reason: Option<String>,
pub session_id: Option<String>,
pub usage: Option<CliUsage>,
pub structured_output: Option<Value>,
}Expand description
Claude CLI –output-format json wrapper.
Fields§
§result: Option<String>§is_error: bool§duration_ms: u64§num_turns: u64§stop_reason: Option<String>§session_id: Option<String>§usage: Option<CliUsage>§structured_output: Option<Value>When --json-schema is used, the structured output appears here
as a parsed JSON value rather than in result.
Implementations§
Source§impl ClaudeCliOutput
impl ClaudeCliOutput
Sourcepub fn total_input_tokens(&self) -> u64
pub fn total_input_tokens(&self) -> u64
Total input tokens (direct + cache creation + cache read).
Sourcepub fn total_output_tokens(&self) -> u64
pub fn total_output_tokens(&self) -> u64
Total output tokens.
Trait Implementations§
Source§impl Clone for ClaudeCliOutput
impl Clone for ClaudeCliOutput
Source§fn clone(&self) -> ClaudeCliOutput
fn clone(&self) -> ClaudeCliOutput
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 moreSource§impl Debug for ClaudeCliOutput
impl Debug for ClaudeCliOutput
Source§impl<'de> Deserialize<'de> for ClaudeCliOutput
impl<'de> Deserialize<'de> for ClaudeCliOutput
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 ClaudeCliOutput
impl RefUnwindSafe for ClaudeCliOutput
impl Send for ClaudeCliOutput
impl Sync for ClaudeCliOutput
impl Unpin for ClaudeCliOutput
impl UnsafeUnpin for ClaudeCliOutput
impl UnwindSafe for ClaudeCliOutput
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