pub struct CostEntry {
pub unit: String,
pub amount: String,
pub currency: String,
}Expand description
A cost entry describing pricing for a specific unit of work.
§Examples
use oas_document::pricing::CostEntry;
let cost = CostEntry {
unit: "request".to_string(),
amount: "0.001".to_string(),
currency: "USD".to_string(),
};Fields§
§unit: StringWhat is being priced: "request", "token", "minute",
"task", "subscription_monthly".
amount: StringAmount as a decimal string (to avoid floating-point issues).
currency: StringISO 4217 currency code (e.g., "USD", "EUR", "BTC", "ETH").
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CostEntry
impl<'de> Deserialize<'de> for CostEntry
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 CostEntry
impl StructuralPartialEq for CostEntry
Auto Trait Implementations§
impl Freeze for CostEntry
impl RefUnwindSafe for CostEntry
impl Send for CostEntry
impl Sync for CostEntry
impl Unpin for CostEntry
impl UnsafeUnpin for CostEntry
impl UnwindSafe for CostEntry
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