pub struct ContinuationState {
pub logical_id: String,
pub config: ContextManagementConfig,
pub policy: ContextState,
pub note: String,
pub window: u64,
pub initialized: bool,
pub latest_archive: Option<String>,
pub last_band: Option<ContextBand>,
pub durability_blocked: bool,
pub token_calibration: Option<TokenCalibration>,
pub calibration_model: Option<String>,
/* private fields */
}Fields§
§logical_id: String§config: ContextManagementConfig§policy: ContextState§note: String§window: u64§initialized: bool§latest_archive: Option<String>§last_band: Option<ContextBand>Band of the latest admission assessment (assess_context) for this
window. Informational only (surfaced to on_message_complete
extension hooks); it is never an input to admission and is cleared
on reset and after a committed rollover.
durability_blocked: boolA head save was requested but not durably acknowledged. Only an explicit session reload/reset resolves that uncertainty; mode toggles do not.
token_calibration: Option<TokenCalibration>Latest provider-reported vs estimated footprint of one request. Kept across rollovers (same tokenizer); cleared with the session binding.
calibration_model: Option<String>Model whose request produced token_calibration. A sample is only
applied to that model (tokenizers differ across providers/models).
Implementations§
Source§impl ContinuationState
impl ContinuationState
pub fn enabled(&self) -> bool
Sourcepub fn calibration_for(&self, model: &str) -> Option<TokenCalibration>
pub fn calibration_for(&self, model: &str) -> Option<TokenCalibration>
The calibration sample, only if it was measured on model.
Sourcepub fn record_calibration(&mut self, model: &str, sample: TokenCalibration)
pub fn record_calibration(&mut self, model: &str, sample: TokenCalibration)
Record the outcome of one request that booked provider usage. An implausible (including zero) count clears the sample.
pub fn checkpoint(&mut self, phase: WorkPhase, note: Option<&str>) -> Result<()>
Sourcepub fn hook_context_management(&self) -> Value
pub fn hook_context_management(&self) -> Value
Advisory context_management snapshot for the on_message_complete
extension hook payload. Disabled => enabled:false, band:null,
phase "unknown". Never exposes the note.
Sourcepub fn report_hook_phase(&mut self, extension_phase: &str)
pub fn report_hook_phase(&mut self, extension_phase: &str)
Apply an advisory phase report from an extension hook. Identical to the
model’s own context_checkpoint with no note; unknown strings warn and
are ignored, as is the disabled error. Never records a note.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContinuationState
impl RefUnwindSafe for ContinuationState
impl Send for ContinuationState
impl Sync for ContinuationState
impl Unpin for ContinuationState
impl UnsafeUnpin for ContinuationState
impl UnwindSafe for ContinuationState
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.