Skip to main content

record_call

Function record_call 

Source
pub fn record_call(
    totals: Option<&mut TokenTotals>,
    persist: Option<&PersistenceStage>,
    metadata: Option<&RunMetadata>,
    call: &CallUsage<'_>,
)
Expand description

Fold one call into the run’s cumulative totals and journal what it cost.

Both halves are optional and independent: a world with no TokenTotals (a bare test agent) still journals, and a world with no persistence lane or run metadata - tests, unpersisted agents - still counts. Neither absence is an error, which is why this takes options rather than making callers branch.