Struct GlobalPricingCatalog
pub struct GlobalPricingCatalog {
pub generated: String,
pub window: String,
pub models: HashMap<String, CatalogModelPrice>,
pub baseline_usd_per_mtok: f64,
pub baseline_model: String,
/* private fields */
}Expand description
The full catalog as loaded from pricing.json, plus a precomputed
lowercase index for O(1) exact lookups on the hot path.
Fields§
§generated: String§window: String§models: HashMap<String, CatalogModelPrice>§baseline_usd_per_mtok: f64§baseline_model: StringImplementations§
Source§impl GlobalPricingCatalog
impl GlobalPricingCatalog
Sourcepub fn priced_len(&self) -> usize
pub fn priced_len(&self) -> usize
Number of priced models in the catalog.
Trait Implementations§
Source§impl Clone for GlobalPricingCatalog
impl Clone for GlobalPricingCatalog
Source§fn clone(&self) -> GlobalPricingCatalog
fn clone(&self) -> GlobalPricingCatalog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GlobalPricingCatalog
impl Debug for GlobalPricingCatalog
Source§impl Default for GlobalPricingCatalog
impl Default for GlobalPricingCatalog
Source§fn default() -> GlobalPricingCatalog
fn default() -> GlobalPricingCatalog
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GlobalPricingCatalog
impl<'de> Deserialize<'de> for GlobalPricingCatalog
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GlobalPricingCatalog
impl RefUnwindSafe for GlobalPricingCatalog
impl Send for GlobalPricingCatalog
impl Sync for GlobalPricingCatalog
impl Unpin for GlobalPricingCatalog
impl UnsafeUnpin for GlobalPricingCatalog
impl UnwindSafe for GlobalPricingCatalog
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more