pub struct ModelPricing {
pub provider: String,
pub model: String,
pub version: String,
pub currency: String,
pub effective_from: DateTime<Utc>,
pub effective_until: Option<DateTime<Utc>>,
pub rates_per_million: BTreeMap<String, Option<u64>>,
}Expand description
Rates are currency micro-units per one million resource units. A missing rate means that the dimension is not priced, not that it is free.
Fields§
§provider: String§model: String§version: String§currency: String§effective_from: DateTime<Utc>§effective_until: Option<DateTime<Utc>>§rates_per_million: BTreeMap<String, Option<u64>>Implementations§
Source§impl ModelPricing
impl ModelPricing
pub fn applies_to(&self, usage: &UsageRecord) -> bool
pub fn overlaps(&self, other: &Self) -> bool
pub fn validate(&self) -> Result<(), PricingError>
Trait Implementations§
Source§impl Clone for ModelPricing
impl Clone for ModelPricing
Source§impl Debug for ModelPricing
impl Debug for ModelPricing
Source§impl<'de> Deserialize<'de> for ModelPricing
impl<'de> Deserialize<'de> for ModelPricing
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
impl Eq for ModelPricing
Source§impl PartialEq for ModelPricing
impl PartialEq for ModelPricing
Source§impl Serialize for ModelPricing
impl Serialize for ModelPricing
impl StructuralPartialEq for ModelPricing
Auto Trait Implementations§
impl Freeze for ModelPricing
impl RefUnwindSafe for ModelPricing
impl Send for ModelPricing
impl Sync for ModelPricing
impl Unpin for ModelPricing
impl UnsafeUnpin for ModelPricing
impl UnwindSafe for ModelPricing
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