pub struct RequestUsage {
pub input_tokens: u32,
pub output_tokens: u32,
pub cache_read_tokens: u32,
pub cache_write_tokens: u32,
pub model: String,
pub start_time: SystemTime,
pub end_time: Option<SystemTime>,
pub cost_usd: f64,
}Expand description
Real-time usage tracking for a single request
Fields§
§input_tokens: u32Input tokens for this request
output_tokens: u32Output tokens accumulated so far
cache_read_tokens: u32Cache read tokens for this request
cache_write_tokens: u32Cache write tokens for this request
model: StringModel used for this request
start_time: SystemTimeRequest start time
end_time: Option<SystemTime>Request completion time
cost_usd: f64Cost for this request
Trait Implementations§
Source§impl Clone for RequestUsage
impl Clone for RequestUsage
Source§fn clone(&self) -> RequestUsage
fn clone(&self) -> RequestUsage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RequestUsage
impl Debug for RequestUsage
Auto Trait Implementations§
impl Freeze for RequestUsage
impl RefUnwindSafe for RequestUsage
impl Send for RequestUsage
impl Sync for RequestUsage
impl Unpin for RequestUsage
impl UnsafeUnpin for RequestUsage
impl UnwindSafe for RequestUsage
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