pub struct BudgetAlert {
pub tenant: String,
pub threshold: f64,
pub tokens_used: u64,
pub tokens_limit: u64,
pub period_start: u64,
}Expand description
Alert generated when budget threshold is crossed.
Fields§
§tenant: StringTenant/client identifier
threshold: f64Threshold that was crossed (e.g., 0.80 for 80%)
tokens_used: u64Current token usage
tokens_limit: u64Budget limit
period_start: u64Current period start time (Unix timestamp)
Implementations§
Source§impl BudgetAlert
impl BudgetAlert
Sourcepub fn usage_percent(&self) -> f64
pub fn usage_percent(&self) -> f64
Get the usage percentage.
Trait Implementations§
Source§impl Clone for BudgetAlert
impl Clone for BudgetAlert
Source§fn clone(&self) -> BudgetAlert
fn clone(&self) -> BudgetAlert
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 moreAuto Trait Implementations§
impl Freeze for BudgetAlert
impl RefUnwindSafe for BudgetAlert
impl Send for BudgetAlert
impl Sync for BudgetAlert
impl Unpin for BudgetAlert
impl UnsafeUnpin for BudgetAlert
impl UnwindSafe for BudgetAlert
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