pub struct PartialUsage {
pub cost_usd: Option<f64>,
pub duration_ms: Option<u64>,
pub input_tokens: Option<u64>,
pub output_tokens: Option<u64>,
}Expand description
Partial usage data from a failed agent invocation.
When an agent step fails (e.g. structured output extraction), the CLI may still report cost, duration, and token counts. This struct carries those values so callers can persist them even on error paths.
Fields§
§cost_usd: Option<f64>Total cost in USD reported by the CLI.
duration_ms: Option<u64>Wall-clock duration reported by the CLI, in milliseconds.
input_tokens: Option<u64>Input tokens consumed before the failure.
output_tokens: Option<u64>Output tokens generated before the failure.
Trait Implementations§
Source§impl Debug for PartialUsage
impl Debug for PartialUsage
Source§impl Default for PartialUsage
impl Default for PartialUsage
Source§fn default() -> PartialUsage
fn default() -> PartialUsage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PartialUsage
impl RefUnwindSafe for PartialUsage
impl Send for PartialUsage
impl Sync for PartialUsage
impl Unpin for PartialUsage
impl UnsafeUnpin for PartialUsage
impl UnwindSafe for PartialUsage
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