#[non_exhaustive]pub enum ServedSpeed {
Uniform(SpeedTier),
Mixed,
}Expand description
Which speed tier a provider actually used, as reported back on the response.
This is the observed counterpart to the requested SpeedTier, and it is a
distinct type because a Usage is not always one response: the agent loop
folds per-call readings into a running total, and a total that mixes an
expedited call with a downgraded one has no single tier. Collapsing that case
to “unknown” would make a real downgrade indistinguishable from a provider
that never reported a tier at all, so it gets its own variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Uniform(SpeedTier)
Every folded reading reported this same tier.
Mixed
Folded readings disagreed — at least one call ran on a different tier than another. Worth investigating: asking for a premium tier and getting this back means something was downgraded.
Implementations§
Source§impl ServedSpeed
impl ServedSpeed
Sourcepub const fn merge(left: Option<Self>, right: Option<Self>) -> Option<Self>
pub const fn merge(left: Option<Self>, right: Option<Self>) -> Option<Self>
Fold another reading in, tracking disagreement rather than hiding it.
None means “no tier reported”, which is not itself a disagreement —
folding it in leaves the known side untouched. Kept const so the
usage accumulators it is called from stay const too.
Whether any folded reading ran on a premium tier.
Trait Implementations§
Source§impl Clone for ServedSpeed
impl Clone for ServedSpeed
Source§fn clone(&self) -> ServedSpeed
fn clone(&self) -> ServedSpeed
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more