pub struct HandleTable { /* private fields */ }Expand description
Per-task handle table. M3 makes the context manager’s partitions a view over this.
Implementations§
Source§impl HandleTable
impl HandleTable
pub fn new() -> Self
pub fn insert(&mut self, handle: Handle)
pub fn get(&self, id: HandleId) -> Option<&Handle>
pub fn get_mut(&mut self, id: HandleId) -> Option<&mut Handle>
pub fn all(&self) -> &[Handle]
pub fn all_mut(&mut self) -> &mut [Handle]
Sourcepub fn retain(&mut self, keep: impl FnMut(&Handle) -> bool)
pub fn retain(&mut self, keep: impl FnMut(&Handle) -> bool)
Retain only the handles for which keep returns true; drop the rest. The GC primitive the
context manager uses to evict handles whose backing message has left working context
(archived by compression / dropped on renewal) — bounding the table to the working set
instead of growing with total session length.
Sourcepub fn residency_for_source(&self, source: &str) -> Option<&Residency>
pub fn residency_for_source(&self, source: &str) -> Option<&Residency>
Residency of the handle anchored to source (e.g. a tool call_id), if any.
The renderer uses this to project a tool result without touching the stored message.
Sourcepub fn tool_result_handles_mut(&mut self) -> impl Iterator<Item = &mut Handle>
pub fn tool_result_handles_mut(&mut self) -> impl Iterator<Item = &mut Handle>
Tool-result handles in insertion (recency) order — oldest first. Used by the residency planner to decide which older results to project out under context pressure.
Sourcepub fn resident_tokens(&self) -> u32
pub fn resident_tokens(&self) -> u32
Sum of tokens for handles still occupying working context.
Sourcepub fn non_resident_tokens(&self) -> u32
pub fn non_resident_tokens(&self) -> u32
Sum of tokens for handles that have left working context (Collapsed / SpooledOut /
PagedOut). Their anchored messages still sit in partitions at full weight (collapse is
non-destructive), so this is exactly the over-count that the estimate rho path must
discount to become paging-aware — see [crate::context::manager::ContextManager::effective_rho].
Trait Implementations§
Source§impl Clone for HandleTable
impl Clone for HandleTable
Source§fn clone(&self) -> HandleTable
fn clone(&self) -> HandleTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more