pub struct ExecutionNode {Show 15 fields
pub uuid: Option<String>,
pub parent_uuid: Option<String>,
pub timestamp: Option<i64>,
pub node_type: NodeType,
pub is_sidechain: Option<bool>,
pub session_id: Option<String>,
pub cwd: Option<String>,
pub message: Option<Message>,
pub tool_use: Option<ToolUse>,
pub tool_result: Option<ToolResult>,
pub tool_use_result: Option<Value>,
pub thinking: Option<String>,
pub progress: Option<Progress>,
pub token_usage: Option<TokenUsage>,
pub extra: Option<HashMap<String, Value>>,
}Expand description
A single execution node in the Claude Code session tree
Represents any event in the transcript: user messages, assistant responses, tool calls, thinking blocks, etc. Nodes are linked via uuid/parentUuid.
Fields§
§uuid: Option<String>Unique identifier for this node
parent_uuid: Option<String>Parent node UUID (for building hierarchy).
The JSONL field is camelCase parentUuid — must match exactly.
timestamp: Option<i64>Timestamp in milliseconds (accepts both ISO 8601 string and number)
node_type: NodeTypeNode type (user, assistant, progress, system, file-history-snapshot, …)
is_sidechain: Option<bool>Whether this node belongs to a sidechain (subagent parallel execution).
session_id: Option<String>Session ID this node belongs to (mirrors the filename stem).
cwd: Option<String>Working directory at the time of this node.
message: Option<Message>Message content (for user/assistant messages)
tool_use: Option<ToolUse>Tool use details (legacy top-level format — real data uses ContentBlock::ToolUse)
tool_result: Option<ToolResult>Tool result (legacy top-level format — real data uses ContentBlock::ToolResult)
tool_use_result: Option<Value>Tool use result (raw tool output - can be string or object)
thinking: Option<String>Thinking content (legacy top-level format)
progress: Option<Progress>Progress updates (legacy field — real data stores progress details in extra["data"])
token_usage: Option<TokenUsage>Token usage statistics
extra: Option<HashMap<String, Value>>Additional metadata (optional to save memory when not present)
Implementations§
Source§impl ExecutionNode
impl ExecutionNode
Sourcepub fn effective_token_usage(&self) -> Option<&TokenUsage>
pub fn effective_token_usage(&self) -> Option<&TokenUsage>
Returns token usage for this node.
Claude Code stores usage inside message.usage, not at the top level.
This helper checks both places so callers don’t need to know the layout.
Sourcepub fn has_error(&self) -> bool
pub fn has_error(&self) -> bool
Returns true if this node represents a tool error.
Checks all known error signals in one place:
tool_result.is_errorflag<tool_use_error>tag intool_result.contenttoolUseResult(raw JSON) deserialized as ToolResult with is_errorContentBlock::ToolResultwith is_error or<tool_use_error>content
Trait Implementations§
Source§impl Clone for ExecutionNode
impl Clone for ExecutionNode
Source§fn clone(&self) -> ExecutionNode
fn clone(&self) -> ExecutionNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExecutionNode
impl Debug for ExecutionNode
Source§impl<'de> Deserialize<'de> for ExecutionNode
impl<'de> Deserialize<'de> for ExecutionNode
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>,
Auto Trait Implementations§
impl Freeze for ExecutionNode
impl RefUnwindSafe for ExecutionNode
impl Send for ExecutionNode
impl Sync for ExecutionNode
impl Unpin for ExecutionNode
impl UnsafeUnpin for ExecutionNode
impl UnwindSafe for ExecutionNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more