pub struct CompressState { /* private fields */ }Expand description
Session-scoped compression accounting (anti-thrash). Owned by the caller
across turns (the TUI keeps one per session, like NoteNudge) and lent
to the loop per call; headless callers may pass None and get a fresh
per-turn state.
Implementations§
Source§impl CompressState
impl CompressState
pub fn new() -> Self
Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
True once anti-thrash has disabled auto-compression for this conversation (read by callers surfacing state and by the conversation-boundary reset tests).
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Re-arm after a conversation boundary. The anti-thrash notice promises
“start a new conversation to reset” — the TUI makes that true by
calling this from /new and /conversation restore (F4).
Sourcepub fn counters(&self) -> CompressCounters
pub fn counters(&self) -> CompressCounters
Read-only counters snapshot for display surfaces (/memory,
Step 18.6, #247). Pure projection of existing state — no new
accounting lives here.
Trait Implementations§
Source§impl Debug for CompressState
impl Debug for CompressState
Auto Trait Implementations§
impl Freeze for CompressState
impl RefUnwindSafe for CompressState
impl Send for CompressState
impl Sync for CompressState
impl Unpin for CompressState
impl UnsafeUnpin for CompressState
impl UnwindSafe for CompressState
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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