pub struct TrimResult {
pub messages: Vec<Message>,
pub replace: bool,
}Expand description
Output of a trim strategy: the trimmed message sequence + how the result is handled.
§Comparison: materialization vs. projection
replace: true(materialized): the result is written back to storage; the replaced old messages are no longer kept. Subsequent retrievals recompute nothing until new messages breach the budget again (the strategy input = previous result + new messages). Heavy operations such as LLM summarization should pick this semantic to avoid recomputation every turn.replace: false(projection): the result is only visible for this retrieval; storage is unchanged and nothing is lost — raising the budget restores all trimmed history. The cost is recomputation whenever over budget, so it suits cheap operations (e.g., window dropping).
Fields§
§messages: Vec<Message>The trimmed message sequence.
replace: boolWhether the result is materialized back into storage (semantics in the type docs).
Trait Implementations§
Source§impl Clone for TrimResult
impl Clone for TrimResult
Source§impl Debug for TrimResult
impl Debug for TrimResult
impl Eq for TrimResult
Source§impl PartialEq for TrimResult
impl PartialEq for TrimResult
impl StructuralPartialEq for TrimResult
Auto Trait Implementations§
impl Freeze for TrimResult
impl RefUnwindSafe for TrimResult
impl Send for TrimResult
impl Sync for TrimResult
impl Unpin for TrimResult
impl UnsafeUnpin for TrimResult
impl UnwindSafe for TrimResult
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.