#[non_exhaustive]pub enum BudgetLimit {
ModelCalls,
PromptTokens,
WallClock,
}Expand description
Which bound of a ResourceBudget ran out.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ModelCalls
The turn made as many model calls as it was allowed.
PromptTokens
The turn sent as many prompt tokens as it was allowed.
WallClock
The turn took as long as it was allowed.
Implementations§
Source§impl BudgetLimit
impl BudgetLimit
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Stable snake-case name, safe on the wire and in a metric label.
Sourcepub fn into_error(self) -> OrchestratorError
pub fn into_error(self) -> OrchestratorError
The typed failure a turn stopped by this bound returns.
It is a PolicyError rather than an internal failure because that is
what it is: a configured limit refused to let the turn continue, and the
caller is entitled to know which one.
Trait Implementations§
Source§impl Clone for BudgetLimit
impl Clone for BudgetLimit
impl Copy for BudgetLimit
Source§impl Debug for BudgetLimit
impl Debug for BudgetLimit
Source§impl Display for BudgetLimit
impl Display for BudgetLimit
impl Eq for BudgetLimit
Source§impl Hash for BudgetLimit
impl Hash for BudgetLimit
Source§impl Ord for BudgetLimit
impl Ord for BudgetLimit
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for BudgetLimit
impl PartialEq for BudgetLimit
Source§impl PartialOrd for BudgetLimit
impl PartialOrd for BudgetLimit
impl StructuralPartialEq for BudgetLimit
Auto Trait Implementations§
impl Freeze for BudgetLimit
impl RefUnwindSafe for BudgetLimit
impl Send for BudgetLimit
impl Sync for BudgetLimit
impl Unpin for BudgetLimit
impl UnsafeUnpin for BudgetLimit
impl UnwindSafe for BudgetLimit
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.