pub struct BudgetExceeded {
pub cap: &'static str,
pub limit: f64,
pub attempted: f64,
}Expand description
Error returned when a record call would push past a cap.
The error names the first cap that would be exceeded; subsequent caps may also be exceeded. The pool’s totals are NOT updated when this error fires — the call is rejected outright.
Fields§
§cap: &'static strWhich cap blew. One of "input_tokens", "output_tokens",
"total_tokens", "cost_usd".
limit: f64The cap limit that was breached.
attempted: f64What the running total would have become.
Trait Implementations§
Source§impl Clone for BudgetExceeded
impl Clone for BudgetExceeded
Source§fn clone(&self) -> BudgetExceeded
fn clone(&self) -> BudgetExceeded
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 moreSource§impl Debug for BudgetExceeded
impl Debug for BudgetExceeded
Source§impl Display for BudgetExceeded
impl Display for BudgetExceeded
Source§impl Error for BudgetExceeded
impl Error for BudgetExceeded
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for BudgetExceeded
impl PartialEq for BudgetExceeded
Source§fn eq(&self, other: &BudgetExceeded) -> bool
fn eq(&self, other: &BudgetExceeded) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for BudgetExceeded
impl StructuralPartialEq for BudgetExceeded
Auto Trait Implementations§
impl Freeze for BudgetExceeded
impl RefUnwindSafe for BudgetExceeded
impl Send for BudgetExceeded
impl Sync for BudgetExceeded
impl Unpin for BudgetExceeded
impl UnsafeUnpin for BudgetExceeded
impl UnwindSafe for BudgetExceeded
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