Skip to main content

Step

Struct Step 

Source
pub struct Step {
Show 13 fields pub label: String, pub detail: String, pub kind: StepKind, pub tool_name: Option<String>, pub timestamp_ms: Option<u64>, pub duration_ms: Option<u64>, pub model: Option<String>, pub tokens_in: Option<u64>, pub tokens_out: Option<u64>, pub cache_read: Option<u64>, pub cache_create: Option<u64>, pub is_fork_root: bool, pub tool_call_id: Option<String>,
}

Fields§

§label: String§detail: String§kind: StepKind§tool_name: Option<String>§timestamp_ms: Option<u64>§duration_ms: Option<u64>§model: Option<String>

Model name for this step, if known. Attached to the first step emitted from each assistant message (see attach_usage_to_first below).

§tokens_in: Option<u64>

Input tokens. Anthropic / OpenAI naming: one-time prompt tokens sent to the model for this assistant response.

§tokens_out: Option<u64>

Output tokens: tokens the model generated in this assistant response.

§cache_read: Option<u64>

Tokens read from the prompt cache (Anthropic). None for providers that don’t support or report cache reads.

§cache_create: Option<u64>

Tokens written to the prompt cache in this response (Anthropic).

§is_fork_root: bool

True when this step is the root of a conversation branch — i.e. its originating entry shares a parentUuid with at least one other entry in the same session. Only set by the Claude Code parser today (the only format where parentUuid is a first-class field); other parsers leave this false. Powers the TUI fork list overlay and status-bar fork count (Phase 5.1).

§tool_call_id: Option<String>

The tool-call ID for ToolUse / ToolResult steps, pairing them across the timeline. Populated by tool_use_step and tool_result_step; every format parser passes this through from its native ID field. Powers Phase 6 trajectory exports (OpenAI fine-tuning format needs the explicit ID on each tool_calls entry and on the matching tool message). None for non-tool step kinds.

Implementations§

Source§

impl Step

Source

pub fn cost_usd(&self) -> Option<f64>

USD cost for this step, computed from its token counters and model. Returns None when the model is unknown or there are no tokens to cost. Delegates to the pricing table in crate::pricing.

Trait Implementations§

Source§

impl Clone for Step

Source§

fn clone(&self) -> Step

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Step

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Step

Source§

fn default() -> Step

Returns the “default value” for a type. Read more
Source§

impl Serialize for Step

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Step

§

impl RefUnwindSafe for Step

§

impl Send for Step

§

impl Sync for Step

§

impl Unpin for Step

§

impl UnsafeUnpin for Step

§

impl UnwindSafe for Step

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.