pub enum ChannelBilling {
Metered {
pricing: Pricing,
},
FlatFee {
monthly_cost_hint: Option<f64>,
quota: Option<Quota>,
on_exhausted: ExhaustedAction,
},
}Expand description
Billing mode for a channel mapping.
Variants§
Metered
Pay-per-use: cost calculated per token at request time.
FlatFee
Fixed fee: monthly subscription, prepaid bundle, free tier, or enterprise contract. Per-request cost = 0.
Implementations§
Source§impl ChannelBilling
impl ChannelBilling
Sourcepub fn from_storage(
billing_str: &str,
pricing_json: &str,
) -> Result<Self, String>
pub fn from_storage( billing_str: &str, pricing_json: &str, ) -> Result<Self, String>
Parse from the storage-layer billing string and pricing JSON.
§Errors
Returns a string error if billing_str is unknown or pricing_json
fails to parse.
Sourcepub fn is_flat_fee(&self) -> bool
pub fn is_flat_fee(&self) -> bool
Returns true when this is a flat-fee billing mode.
Trait Implementations§
Source§impl Clone for ChannelBilling
impl Clone for ChannelBilling
Source§fn clone(&self) -> ChannelBilling
fn clone(&self) -> ChannelBilling
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 moreAuto Trait Implementations§
impl Freeze for ChannelBilling
impl RefUnwindSafe for ChannelBilling
impl Send for ChannelBilling
impl Sync for ChannelBilling
impl Unpin for ChannelBilling
impl UnsafeUnpin for ChannelBilling
impl UnwindSafe for ChannelBilling
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