pub struct MemoryPolicy {
pub max_window_tokens: usize,
pub max_window_messages: usize,
pub keep_tail_turns: usize,
pub demotion_enabled: bool,
pub compaction_enabled: bool,
pub compaction_trigger_ratio: f64,
}Expand description
Policy controlling active window management.
Fields§
§max_window_tokens: usizeMaximum tokens in the active window before triggering trim.
max_window_messages: usizeMaximum number of messages in the active window.
keep_tail_turns: usizeNumber of most recent turns to always retain.
demotion_enabled: boolWhether demotion to long-term storage is enabled.
compaction_enabled: boolWhether compaction (summarization) is enabled.
compaction_trigger_ratio: f64Fraction of max_window_tokens at which proactive compaction triggers (0.0-1.0).
Trait Implementations§
Source§impl Clone for MemoryPolicy
impl Clone for MemoryPolicy
Source§fn clone(&self) -> MemoryPolicy
fn clone(&self) -> MemoryPolicy
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 MemoryPolicy
impl Debug for MemoryPolicy
Source§impl Default for MemoryPolicy
impl Default for MemoryPolicy
Source§impl<'de> Deserialize<'de> for MemoryPolicy
impl<'de> Deserialize<'de> for MemoryPolicy
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 MemoryPolicy
impl RefUnwindSafe for MemoryPolicy
impl Send for MemoryPolicy
impl Sync for MemoryPolicy
impl Unpin for MemoryPolicy
impl UnsafeUnpin for MemoryPolicy
impl UnwindSafe for MemoryPolicy
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