#[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<ServedSpeed>,
right: Option<ServedSpeed>,
) -> Option<ServedSpeed>
pub const fn merge( left: Option<ServedSpeed>, right: Option<ServedSpeed>, ) -> Option<ServedSpeed>
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 moreimpl Copy for ServedSpeed
Source§impl Debug for ServedSpeed
impl Debug for ServedSpeed
Source§impl<'de> Deserialize<'de> for ServedSpeed
impl<'de> Deserialize<'de> for ServedSpeed
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServedSpeed, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServedSpeed, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ServedSpeed
Source§impl PartialEq for ServedSpeed
impl PartialEq for ServedSpeed
Source§impl Serialize for ServedSpeed
impl Serialize for ServedSpeed
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ServedSpeed
Auto Trait Implementations§
impl Freeze for ServedSpeed
impl RefUnwindSafe for ServedSpeed
impl Send for ServedSpeed
impl Sync for ServedSpeed
impl Unpin for ServedSpeed
impl UnsafeUnpin for ServedSpeed
impl UnwindSafe for ServedSpeed
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
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.