pub struct BillingCostConfig {
pub input_text: TextCost,
pub output_text: TextCost,
pub input_pixels: ImageCost,
pub output_pixels: ImageCost,
}Expand description
四元矩阵成本配置
Fields§
§input_text: TextCost输入文本成本 (每百万 Tokens)
output_text: TextCost输出文本成本 (每百万 Tokens)
input_pixels: ImageCost输入图像成本 (每百万像素)
output_pixels: ImageCost输出图像成本 (每百万像素)
Implementations§
Source§impl BillingCostConfig
impl BillingCostConfig
Sourcepub fn calculate_total_cost(&self, usage: &BillingDimensions) -> Decimal
pub fn calculate_total_cost(&self, usage: &BillingDimensions) -> Decimal
计算总成本 (单位:Decimal)
计算公式: (消耗数量 / 1,000,000) * 每百万单价
Trait Implementations§
Source§impl Clone for BillingCostConfig
impl Clone for BillingCostConfig
Source§fn clone(&self) -> BillingCostConfig
fn clone(&self) -> BillingCostConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 BillingCostConfig
impl Debug for BillingCostConfig
Source§impl<'de> Deserialize<'de> for BillingCostConfig
impl<'de> Deserialize<'de> for BillingCostConfig
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 BillingCostConfig
impl RefUnwindSafe for BillingCostConfig
impl Send for BillingCostConfig
impl Sync for BillingCostConfig
impl Unpin for BillingCostConfig
impl UnsafeUnpin for BillingCostConfig
impl UnwindSafe for BillingCostConfig
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