pub struct ProviderUsage {
pub provider_id: String,
pub frames_served: u32,
pub frames_rejected: u32,
pub token_cost: u64,
pub served_frames: Vec<ServedFrame>,
}Expand description
One provider’s usage within a single query: how many frames it served, how many were rejected, the summed token cost, and the served frames’ identities.
Fields§
§provider_id: StringThe host-facing id of the provider (the routing/consent key).
frames_served: u32Frames the host accepted from this provider (passed consent, timeout,
and the budget-honesty audit). Equal to served_frames.len().
frames_rejected: u32Frames the provider offered that the host rejected — a provider that
blew the budget has its frames dropped as a token_cost lie
(§protocol-surface B2), and once verification is wired
a frame verified stale/gone is rejected too.
token_cost: u64Summed token_cost of the served frames — the provider’s contribution
to the request’s consumed budget.
served_frames: Vec<ServedFrame>The served frames, each by stable identity + declared cost, so an auditor can walk from this provider’s total to the exact frames.
Implementations§
Source§impl ProviderUsage
impl ProviderUsage
Sourcepub fn served_token_cost(&self) -> u64
pub fn served_token_cost(&self) -> u64
Re-sum the served frames’ declared costs. Equals token_cost
for a consistently-built report — the arithmetic identity a metering
pipeline checks before trusting the total (§2).
Sourcepub fn is_consistent(&self) -> bool
pub fn is_consistent(&self) -> bool
Whether this provider’s aggregate agrees with its itemized frames:
frames_served == served_frames.len() and
token_cost == served_token_cost().
Trait Implementations§
Source§impl Clone for ProviderUsage
impl Clone for ProviderUsage
Source§fn clone(&self) -> ProviderUsage
fn clone(&self) -> ProviderUsage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more