pub struct EconomicsUsage {
pub input_uncached: u64,
pub cache_write: u64,
pub cache_read: u64,
pub output: u64,
pub reasoning: Option<u64>,
pub total_input: u64,
pub total: u64,
pub requests: u64,
pub tool_calls: u64,
pub cost_microusd: Option<u64>,
}Expand description
A run’s totals, derived from its raw usage.
use majordomus_cli::economics::model::EconomicsUsage;
let u = EconomicsUsage {
input_uncached: 10, cache_write: 90, cache_read: 900, output: 50,
total_input: 1000, total: 1050, requests: 3, ..EconomicsUsage::default()
};
assert_eq!(u.total_input, u.input_uncached + u.cache_write + u.cache_read);
let json = serde_json::to_value(&u).unwrap();
assert!(json.get("reasoning").is_none() && json.get("cost_microusd").is_none());Fields§
§input_uncached: u64Input neither read from nor written to the cache.
cache_write: u64Input written to the cache.
cache_read: u64Input read from the cache.
output: u64Output, reasoning included.
reasoning: Option<u64>Reasoning tokens, when every request reported them.
total_input: u64All input.
total: u64All input and output.
requests: u64Provider requests.
tool_calls: u64Tool calls.
cost_microusd: Option<u64>The harness’s cost projection, in millionths of a dollar, when every session had one.
Trait Implementations§
Source§impl Clone for EconomicsUsage
impl Clone for EconomicsUsage
Source§fn clone(&self) -> EconomicsUsage
fn clone(&self) -> EconomicsUsage
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 EconomicsUsage
impl Debug for EconomicsUsage
Source§impl Default for EconomicsUsage
impl Default for EconomicsUsage
Source§fn default() -> EconomicsUsage
fn default() -> EconomicsUsage
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EconomicsUsage
impl<'de> Deserialize<'de> for EconomicsUsage
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 EconomicsUsage
Source§impl JsonSchema for EconomicsUsage
impl JsonSchema for EconomicsUsage
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 EconomicsUsage
impl PartialEq for EconomicsUsage
Source§fn eq(&self, other: &EconomicsUsage) -> bool
fn eq(&self, other: &EconomicsUsage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EconomicsUsage
impl Serialize for EconomicsUsage
impl StructuralPartialEq for EconomicsUsage
Auto Trait Implementations§
impl Freeze for EconomicsUsage
impl RefUnwindSafe for EconomicsUsage
impl Send for EconomicsUsage
impl Sync for EconomicsUsage
impl Unpin for EconomicsUsage
impl UnsafeUnpin for EconomicsUsage
impl UnwindSafe for EconomicsUsage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.