pub struct BudgetCap {
pub window: BudgetWindow,
pub hard_limit_usd: f64,
pub soft_limit_usd: Option<f64>,
}Expand description
A USD budget cap for a given time window.
Fields§
§window: BudgetWindowWhich time window this cap applies to.
hard_limit_usd: f64Hard cap in USD — requests are rejected (429) when exceeded.
soft_limit_usd: Option<f64>Optional soft cap in USD — triggers an alert but allows the request.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BudgetCap
impl<'de> Deserialize<'de> for BudgetCap
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 BudgetCap
impl RefUnwindSafe for BudgetCap
impl Send for BudgetCap
impl Sync for BudgetCap
impl Unpin for BudgetCap
impl UnsafeUnpin for BudgetCap
impl UnwindSafe for BudgetCap
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