pub struct ContextUsage {
pub tokens: Option<u64>,
pub window: Option<u64>,
pub percent: Option<u64>,
pub warn: bool,
pub since_switch: bool,
pub model: Option<String>,
}Expand description
How full the conversation’s context window is, as the phone shows it.
Derived at read time and never persisted. None means unknown, which the
UI says in words - it is never a made-up 0.
Fields§
§tokens: Option<u64>Tokens the last agent reply’s turn read, if its CLI reported any.
window: Option<u64>Window of the conversation’s current model, if one is configured.
percent: Option<u64>tokens / window, rounded down, not capped (over 100 is real news).
warn: bool80% or more, judged before rounding: the conversation is getting long.
since_switch: boolThe conversation’s agent or model is not the one that produced
tokens: the figure describes the old session and the next turn
re-measures it.
model: Option<String>The current model, if the roster names one.
Trait Implementations§
Source§impl Clone for ContextUsage
impl Clone for ContextUsage
Source§impl Debug for ContextUsage
impl Debug for ContextUsage
Source§impl Default for ContextUsage
impl Default for ContextUsage
impl Eq for ContextUsage
Source§impl PartialEq for ContextUsage
impl PartialEq for ContextUsage
Source§impl Serialize for ContextUsage
impl Serialize for ContextUsage
impl StructuralPartialEq for ContextUsage
Auto Trait Implementations§
impl Freeze for ContextUsage
impl RefUnwindSafe for ContextUsage
impl Send for ContextUsage
impl Sync for ContextUsage
impl Unpin for ContextUsage
impl UnsafeUnpin for ContextUsage
impl UnwindSafe for ContextUsage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.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