pub enum CompactTrigger {
Auto,
Manual,
}Expand description
Why compaction was triggered.
Distinguishes between automatic threshold-based compaction and manual compaction requested by the agent or user. Hooks consult this to apply different policies per source — for example, allowing a manual compaction to proceed while aborting an automatic one during a sensitive operation.
Variants§
Auto
Automatic compaction triggered by a token threshold.
Fired when token usage crosses
SessionConfig::compact_threshold
or the 95% emergency line. The compactor decided to run on its
own; no caller asked for it.
Manual
Manual compaction requested by the agent or user.
Fired by an explicit compaction request — for example the agent invoking a “compact now” tool, or a host application reacting to a user gesture. The caller asked for it, independent of token usage.
Trait Implementations§
Source§impl Clone for CompactTrigger
impl Clone for CompactTrigger
Source§fn clone(&self) -> CompactTrigger
fn clone(&self) -> CompactTrigger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CompactTrigger
Source§impl Debug for CompactTrigger
impl Debug for CompactTrigger
Source§impl<'de> Deserialize<'de> for CompactTrigger
impl<'de> Deserialize<'de> for CompactTrigger
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>,
impl Eq for CompactTrigger
Source§impl From<CompactReason> for CompactTrigger
impl From<CompactReason> for CompactTrigger
Source§fn from(reason: CompactReason) -> Self
fn from(reason: CompactReason) -> Self
Map the compaction pipeline’s CompactReason into the hook-level
CompactTrigger.
ThresholdExceeded
and Emergency
are both automatic triggers (they collapse to
Auto), while
Manual maps to
Manual.
Source§impl PartialEq for CompactTrigger
impl PartialEq for CompactTrigger
Source§impl Serialize for CompactTrigger
impl Serialize for CompactTrigger
impl StructuralPartialEq for CompactTrigger
Auto Trait Implementations§
impl Freeze for CompactTrigger
impl RefUnwindSafe for CompactTrigger
impl Send for CompactTrigger
impl Sync for CompactTrigger
impl Unpin for CompactTrigger
impl UnsafeUnpin for CompactTrigger
impl UnwindSafe for CompactTrigger
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
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.