pub struct SessionBudgetSnapshot {
pub session_id: String,
pub tokens_used: u64,
pub soft_limit_tokens: u64,
pub hard_limit_tokens: u64,
pub soft_limit_reached: bool,
pub hard_limit_reached: bool,
pub last_updated: Option<DateTime<Utc>>,
pub last_reset: Option<DateTime<Utc>>,
pub request_count: u64,
}Expand description
A point-in-time snapshot of a session’s budget state.
Returned by GET /v1/sessions/{id}/budget.
Fields§
§session_id: StringSession identifier.
tokens_used: u64Tokens accumulated this window.
soft_limit_tokens: u64Soft limit threshold.
hard_limit_tokens: u64Hard limit threshold (requests blocked above this).
soft_limit_reached: booltrue when tokens_used >= soft_limit_tokens.
hard_limit_reached: booltrue when tokens_used >= hard_limit_tokens.
last_updated: Option<DateTime<Utc>>UTC timestamp of the last token recording.
last_reset: Option<DateTime<Utc>>UTC timestamp of the last manual or automatic reset.
request_count: u64Number of requests recorded this window.
Trait Implementations§
Source§impl Clone for SessionBudgetSnapshot
impl Clone for SessionBudgetSnapshot
Source§fn clone(&self) -> SessionBudgetSnapshot
fn clone(&self) -> SessionBudgetSnapshot
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 SessionBudgetSnapshot
impl Debug for SessionBudgetSnapshot
Source§impl<'de> Deserialize<'de> for SessionBudgetSnapshot
impl<'de> Deserialize<'de> for SessionBudgetSnapshot
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 SessionBudgetSnapshot
impl RefUnwindSafe for SessionBudgetSnapshot
impl Send for SessionBudgetSnapshot
impl Sync for SessionBudgetSnapshot
impl Unpin for SessionBudgetSnapshot
impl UnsafeUnpin for SessionBudgetSnapshot
impl UnwindSafe for SessionBudgetSnapshot
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>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request