pub struct BudgetStatus {
pub token_budget: u64,
pub tokens_used: u64,
pub time_budget_ms: u64,
pub time_used_ms: u64,
pub max_recursion_depth: u32,
pub current_recursion_depth: u32,
}Expand description
Budget tracking status for a session.
Fields§
§token_budget: u64Total tokens allowed.
tokens_used: u64Tokens consumed so far.
time_budget_ms: u64Time budget in milliseconds.
time_used_ms: u64Time consumed in milliseconds.
max_recursion_depth: u32Maximum recursion depth allowed.
current_recursion_depth: u32Current recursion depth.
Implementations§
Source§impl BudgetStatus
impl BudgetStatus
Sourcepub fn tokens_exhausted(&self) -> bool
pub fn tokens_exhausted(&self) -> bool
Check if token budget is exhausted.
Sourcepub fn time_exhausted(&self) -> bool
pub fn time_exhausted(&self) -> bool
Check if time budget is exhausted.
Sourcepub fn depth_exhausted(&self) -> bool
pub fn depth_exhausted(&self) -> bool
Check if recursion depth limit is reached.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Check if any budget is exhausted.
Sourcepub fn tokens_remaining(&self) -> u64
pub fn tokens_remaining(&self) -> u64
Get remaining token budget.
Sourcepub fn time_remaining_ms(&self) -> u64
pub fn time_remaining_ms(&self) -> u64
Get remaining time budget in milliseconds.
Trait Implementations§
Source§impl Clone for BudgetStatus
impl Clone for BudgetStatus
Source§fn clone(&self) -> BudgetStatus
fn clone(&self) -> BudgetStatus
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 BudgetStatus
impl Debug for BudgetStatus
Source§impl Default for BudgetStatus
impl Default for BudgetStatus
Source§impl<'de> Deserialize<'de> for BudgetStatus
impl<'de> Deserialize<'de> for BudgetStatus
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 BudgetStatus
impl RefUnwindSafe for BudgetStatus
impl Send for BudgetStatus
impl Sync for BudgetStatus
impl Unpin for BudgetStatus
impl UnsafeUnpin for BudgetStatus
impl UnwindSafe for BudgetStatus
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more