pub struct ContextState { /* private fields */ }Expand description
Per-context state. Private counters prevent phase reports from replenishing the allowance. The host must preserve this state across model rounds.
Implementations§
Source§impl ContextState
impl ContextState
pub fn phase(&self) -> WorkPhase
pub fn finish_rounds_used(&self) -> u32
Sourcepub fn report_phase(&mut self, phase: WorkPhase)
pub fn report_phase(&mut self, phase: WorkPhase)
Record advisory progress. Intermediate Unknown/WrapUp reports cannot hide a Plan -> Execute transition, nor can reports reset an extension.
Sourcepub fn defer_unproductive_rollover(&mut self, used_tokens: u64)
pub fn defer_unproductive_rollover(&mut self, used_tokens: u64)
Host-only: candidate cannot meaningfully shrink, but the current full request still passes hard admission. Keep task/finish state intact and avoid a no-op archive/rollover loop. Reassess after bounded progress.
Trait Implementations§
Source§impl Clone for ContextState
impl Clone for ContextState
impl Copy for ContextState
Source§impl Debug for ContextState
impl Debug for ContextState
Source§impl Default for ContextState
impl Default for ContextState
impl Eq for ContextState
Source§impl PartialEq for ContextState
impl PartialEq for ContextState
impl StructuralPartialEq for ContextState
Auto Trait Implementations§
impl Freeze for ContextState
impl RefUnwindSafe for ContextState
impl Send for ContextState
impl Sync for ContextState
impl Unpin for ContextState
impl UnsafeUnpin for ContextState
impl UnwindSafe for ContextState
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§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.