pub struct ReportedUsage {
pub input_tokens: u64,
pub output_tokens: u64,
pub cache_read_tokens: u64,
pub cache_write_tokens: u64,
pub reasoning_tokens: u64,
}Expand description
Provider-reported usage for one model call. Input/cache lanes are disjoint; reasoning is a subset of output and must not be added to the output total.
Fields§
§input_tokens: u64§output_tokens: u64§cache_read_tokens: u64§cache_write_tokens: u64§reasoning_tokens: u64Implementations§
Source§impl ReportedUsage
impl ReportedUsage
pub fn prompt_tokens(&self) -> u64
Sourcepub fn merge_snapshot(&mut self, snapshot: &Self)
pub fn merge_snapshot(&mut self, snapshot: &Self)
Merge cumulative, partially populated snapshots of the SAME call. Do not use this to aggregate distinct requests.
Trait Implementations§
Source§impl Clone for ReportedUsage
impl Clone for ReportedUsage
Source§fn clone(&self) -> ReportedUsage
fn clone(&self) -> ReportedUsage
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 ReportedUsage
impl Debug for ReportedUsage
Source§impl Default for ReportedUsage
impl Default for ReportedUsage
Source§fn default() -> ReportedUsage
fn default() -> ReportedUsage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ReportedUsage
impl<'de> Deserialize<'de> for ReportedUsage
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ReportedUsage
Source§impl JsonSchema for ReportedUsage
impl JsonSchema for ReportedUsage
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ReportedUsage
impl PartialEq for ReportedUsage
Source§fn eq(&self, other: &ReportedUsage) -> bool
fn eq(&self, other: &ReportedUsage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ReportedUsage
impl Serialize for ReportedUsage
impl StructuralPartialEq for ReportedUsage
Auto Trait Implementations§
impl Freeze for ReportedUsage
impl RefUnwindSafe for ReportedUsage
impl Send for ReportedUsage
impl Sync for ReportedUsage
impl Unpin for ReportedUsage
impl UnsafeUnpin for ReportedUsage
impl UnwindSafe for ReportedUsage
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