pub struct ContextWindow {
pub used: Option<Percent>,
pub size: Option<u32>,
pub total_input_tokens: Option<u64>,
pub total_output_tokens: Option<u64>,
pub current_usage: Option<TurnUsage>,
}Fields§
§used: Option<Percent>Used percentage. remaining() derives from this. Per ADR-0014,
None when CC emits used_percentage: null (the pre-first-API-
call window, see docs/research/context-window-correctness.md)
or the leaf is otherwise malformed.
size: Option<u32>Context-window size in tokens. u32 matches ADR-0014’s Shape
section; values outside the u32 range degrade to None.
total_input_tokens: Option<u64>§total_output_tokens: Option<u64>§current_usage: Option<TurnUsage>Tokens consumed by the most recent API call; None before the
first call in a session. Distinct from total_*_tokens above,
which are cumulative across the whole session.
Implementations§
Trait Implementations§
Source§impl Clone for ContextWindow
impl Clone for ContextWindow
Source§fn clone(&self) -> ContextWindow
fn clone(&self) -> ContextWindow
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 moreAuto Trait Implementations§
impl Freeze for ContextWindow
impl RefUnwindSafe for ContextWindow
impl Send for ContextWindow
impl Sync for ContextWindow
impl Unpin for ContextWindow
impl UnsafeUnpin for ContextWindow
impl UnwindSafe for ContextWindow
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