pub struct ContextUsage {
pub used_tokens: u64,
pub peak_tokens: u64,
pub max_tokens: Option<u64>,
pub used_percent: Option<f64>,
pub model: Option<String>,
pub compactions: u64,
}Expand description
How full a run’s context window is
Fields§
§used_tokens: u64Tokens the last main-thread request filled (prompt plus output)
peak_tokens: u64Largest fill of any main-thread request
max_tokens: Option<u64>The model’s context window, when the tool reports it
used_percent: Option<f64>used_tokens as a share of max_tokens, 0-100
model: Option<String>Model of the last request (Claude)
compactions: u64How many times the tool compacted the conversation
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
Source§impl<'de> Deserialize<'de> for ContextUsage
impl<'de> Deserialize<'de> for ContextUsage
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 PartialEq for ContextUsage
impl PartialEq for ContextUsage
Source§impl Serialize for ContextUsage
impl Serialize for ContextUsage
impl StructuralPartialEq for ContextUsage
Auto Trait Implementations§
impl Forget for ContextUsage
impl Freeze for ContextUsage
impl Move for ContextUsage
impl RefUnwindSafe for ContextUsage
impl Send for ContextUsagewhere
RawVecInner: Send,
impl Sync for ContextUsagewhere
RawVecInner: Sync,
impl Unpin for ContextUsage
impl UnsafeUnpin for ContextUsage
impl UnwindSafe for ContextUsagewhere
RawVecInner: UnwindSafe,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.