pub enum UsageLimitError {
NextRequest {
limit: u64,
next_requests: u64,
},
Token {
kind: UsageTokenKind,
limit: u64,
actual: u64,
},
ToolCalls {
limit: u64,
tool_calls: u64,
},
}Expand description
Usage limit error.
Variants§
NextRequest
The next request would exceed request budget.
Token
Accumulated usage exceeded a token budget.
ToolCalls
Projected successful function tool calls would exceed the configured budget.
Trait Implementations§
Source§impl Clone for UsageLimitError
impl Clone for UsageLimitError
Source§fn clone(&self) -> UsageLimitError
fn clone(&self) -> UsageLimitError
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 UsageLimitError
impl Debug for UsageLimitError
Source§impl<'de> Deserialize<'de> for UsageLimitError
impl<'de> Deserialize<'de> for UsageLimitError
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
Source§impl Display for UsageLimitError
impl Display for UsageLimitError
impl Eq for UsageLimitError
Source§impl Error for UsageLimitError
impl Error for UsageLimitError
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 UsageLimitError
impl PartialEq for UsageLimitError
Source§fn eq(&self, other: &UsageLimitError) -> bool
fn eq(&self, other: &UsageLimitError) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for UsageLimitError
impl Serialize for UsageLimitError
impl StructuralPartialEq for UsageLimitError
Auto Trait Implementations§
impl Freeze for UsageLimitError
impl RefUnwindSafe for UsageLimitError
impl Send for UsageLimitError
impl Sync for UsageLimitError
impl Unpin for UsageLimitError
impl UnsafeUnpin for UsageLimitError
impl UnwindSafe for UsageLimitError
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