pub enum ClaudeLine {
System {
subtype: String,
cwd: Option<String>,
session_id: String,
model: String,
permission_mode: Option<String>,
tools: Vec<String>,
mcp_servers: Option<Value>,
version: String,
},
Assistant {
message: Value,
session_id: String,
},
User {
message: Value,
session_id: String,
},
Result {
subtype: String,
is_error: bool,
result: String,
session_id: String,
total_cost_usd: f64,
duration_ms: u64,
num_turns: u64,
model: String,
stop_reason: Option<String>,
usage: Value,
model_usage: Value,
},
}Expand description
One NDJSON line of Claude’s stream-json output.
Serialized with an internal type tag so each variant renders as
{"type":"<variant>", …}.
Variants§
System
system init line — emitted once at process start (not from an event).
Fields
Assistant
assistant line carrying a full assistant message.
User
user line carrying tool results back to the model’s view.
Result
result line — the turn terminator (exactly one per turn).
Trait Implementations§
Source§impl Clone for ClaudeLine
impl Clone for ClaudeLine
Source§impl Debug for ClaudeLine
impl Debug for ClaudeLine
Auto Trait Implementations§
impl Forget for ClaudeLine
impl Freeze for ClaudeLine
impl Move for ClaudeLine
impl RefUnwindSafe for ClaudeLine
impl Send for ClaudeLine
impl Sync for ClaudeLine
impl Unpin for ClaudeLine
impl UnsafeUnpin for ClaudeLine
impl UnwindSafe for ClaudeLine
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