pub struct ContextSectionRegistry { /* private fields */ }Expand description
Registry for prompt/context sections and their lifecycle policy.
Implementations§
Source§impl ContextSectionRegistry
impl ContextSectionRegistry
pub fn new() -> Self
Sourcepub fn default_agent_sections() -> Self
pub fn default_agent_sections() -> Self
Baseline sections that match DeepStrike’s current 5-partition context.
pub fn upsert(&mut self, section: ContextSection)
pub fn get(&self, id: &str) -> Option<&ContextSection>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn sections(&self) -> Vec<&ContextSection>
pub fn plan(&self) -> ContextSectionPlan
Sourcepub fn pin(&mut self, id: &str) -> bool
pub fn pin(&mut self, id: &str) -> bool
Pin a section so its partition is exempt from GC compression. Returns true if the section was found.
Sourcepub fn unpin(&mut self, id: &str) -> bool
pub fn unpin(&mut self, id: &str) -> bool
Unpin a section, allowing its partition to be compressed again. Returns true if the section was found.
Sourcepub fn is_partition_pinned(&self, partition: ContextSectionPartition) -> bool
pub fn is_partition_pinned(&self, partition: ContextSectionPartition) -> bool
Returns true if any enabled section mapped to partition is pinned.
Sourcepub fn invalidate(&mut self, event: SectionInvalidation) -> Vec<CompactString>
pub fn invalidate(&mut self, event: SectionInvalidation) -> Vec<CompactString>
Mark sections invalidated by an event as disabled and return their ids.
Trait Implementations§
Source§impl Clone for ContextSectionRegistry
impl Clone for ContextSectionRegistry
Source§fn clone(&self) -> ContextSectionRegistry
fn clone(&self) -> ContextSectionRegistry
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 moreSource§impl Debug for ContextSectionRegistry
impl Debug for ContextSectionRegistry
Source§impl Default for ContextSectionRegistry
impl Default for ContextSectionRegistry
Source§fn default() -> ContextSectionRegistry
fn default() -> ContextSectionRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ContextSectionRegistry
impl<'de> Deserialize<'de> for ContextSectionRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ContextSectionRegistry
impl RefUnwindSafe for ContextSectionRegistry
impl Send for ContextSectionRegistry
impl Sync for ContextSectionRegistry
impl Unpin for ContextSectionRegistry
impl UnsafeUnpin for ContextSectionRegistry
impl UnwindSafe for ContextSectionRegistry
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