pub enum CostResolution {
Resolved,
Unpriced,
Unknown,
}Expand description
Whether the cost in a CostInfo was actually determined. Consumers must
check this before treating the reported amount as truth: only Resolved
carries an authoritative USD cost. Neither Unpriced nor Unknown may be
silently counted as a real zero.
Variants§
Resolved
The USD cost is authoritative (returned natively by the provider, or
derived from real token counts and a configured TokenPrice).
Unpriced
Token counts are real, but the provider returns no native cost and no
TokenPrice was configured for this generator/request, so the USD amount
is unknown. Set a TokenPrice (on the generator or per-request) to resolve
it. The cost field is 0.0 and must NOT be treated as a free request.
Unknown
Cost could not be determined at all (no usage was returned and any out-of-band query failed). Numeric fields are best-effort.
Trait Implementations§
Source§impl Clone for CostResolution
impl Clone for CostResolution
Source§fn clone(&self) -> CostResolution
fn clone(&self) -> CostResolution
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 CostResolution
Source§impl Debug for CostResolution
impl Debug for CostResolution
Source§impl Default for CostResolution
impl Default for CostResolution
Source§fn default() -> CostResolution
fn default() -> CostResolution
Source§impl<'de> Deserialize<'de> for CostResolution
impl<'de> Deserialize<'de> for CostResolution
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>,
impl Eq for CostResolution
Source§impl PartialEq for CostResolution
impl PartialEq for CostResolution
Source§fn eq(&self, other: &CostResolution) -> bool
fn eq(&self, other: &CostResolution) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CostResolution
impl Serialize for CostResolution
impl StructuralPartialEq for CostResolution
Auto Trait Implementations§
impl Freeze for CostResolution
impl RefUnwindSafe for CostResolution
impl Send for CostResolution
impl Sync for CostResolution
impl Unpin for CostResolution
impl UnsafeUnpin for CostResolution
impl UnwindSafe for CostResolution
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
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.