pub struct ModelPriceCatalog { /* private fields */ }Implementations§
Source§impl ModelPriceCatalog
impl ModelPriceCatalog
pub fn new() -> Self
pub fn with_prices(prices: impl IntoIterator<Item = ModelPrice>) -> Self
pub fn insert(&mut self, price: ModelPrice)
pub fn price_for_model(&self, model: &str) -> Option<&ModelPrice>
pub fn estimate_usage_cost( &self, model: &str, usage: &UsageMetrics, adjustments: CostAdjustments, ) -> CostBreakdown
pub fn estimate_usage_cost_with_accounting( &self, model: &str, usage: &UsageMetrics, adjustments: CostAdjustments, accounting: CacheInputAccounting, ) -> CostBreakdown
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn snapshot(&self, source: impl Into<String>) -> ModelPriceCatalogSnapshot
Trait Implementations§
Source§impl Clone for ModelPriceCatalog
impl Clone for ModelPriceCatalog
Source§fn clone(&self) -> ModelPriceCatalog
fn clone(&self) -> ModelPriceCatalog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelPriceCatalog
impl Debug for ModelPriceCatalog
Source§impl Default for ModelPriceCatalog
impl Default for ModelPriceCatalog
Source§fn default() -> ModelPriceCatalog
fn default() -> ModelPriceCatalog
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModelPriceCatalog
impl RefUnwindSafe for ModelPriceCatalog
impl Send for ModelPriceCatalog
impl Sync for ModelPriceCatalog
impl Unpin for ModelPriceCatalog
impl UnsafeUnpin for ModelPriceCatalog
impl UnwindSafe for ModelPriceCatalog
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