pub struct PersistenceConfig {
pub auto_save: bool,
pub auto_load: bool,
pub token_limit: usize,
}Expand description
Memory persistence configuration
P1-3: 删除 max_messages 死字段(全库无压缩逻辑引用它,with_max_messages(50)
是“API 承诺多于实现“);token_limit 作为 token 预算的单一来源,构造参数与
with_config 都落到它。
Fields§
§auto_save: boolAuto-save after each save_context call
auto_load: boolAuto-load on first access
token_limit: usizeToken limit for summary buffer memory
Implementations§
Source§impl PersistenceConfig
impl PersistenceConfig
pub fn new() -> Self
pub fn with_auto_save(self, auto_save: bool) -> Self
pub fn with_auto_load(self, auto_load: bool) -> Self
pub fn with_token_limit(self, token_limit: usize) -> Self
Trait Implementations§
Source§impl Clone for PersistenceConfig
impl Clone for PersistenceConfig
Source§fn clone(&self) -> PersistenceConfig
fn clone(&self) -> PersistenceConfig
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 PersistenceConfig
impl Debug for PersistenceConfig
Auto Trait Implementations§
impl Freeze for PersistenceConfig
impl RefUnwindSafe for PersistenceConfig
impl Send for PersistenceConfig
impl Sync for PersistenceConfig
impl Unpin for PersistenceConfig
impl UnsafeUnpin for PersistenceConfig
impl UnwindSafe for PersistenceConfig
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