pub struct EvictionPlan {
pub ops: Vec<EvictionOp>,
}Expand description
An ordered set of eviction actions returned by the planner. Empty = no compression needed (“能不压就不压”). The order is the execution order.
Fields§
§ops: Vec<EvictionOp>Implementations§
Source§impl EvictionPlan
impl EvictionPlan
pub fn empty() -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn has_time_decay(&self) -> bool
pub fn has_time_decay(&self) -> bool
Whether the plan includes the Layer-3 idle/time-decay micro op.
Sourcepub fn from_legacy_action(
action: PressureAction,
target_tokens: u32,
preserve_turns: usize,
) -> Self
pub fn from_legacy_action( action: PressureAction, target_tokens: u32, preserve_turns: usize, ) -> Self
Map legacy PressureAction → the new specific op (for behavior-preserving migration).
The old recommend() returns one of 5 actions; we map them 1:1 onto the new ops.
Trait Implementations§
Source§impl Clone for EvictionPlan
impl Clone for EvictionPlan
Source§fn clone(&self) -> EvictionPlan
fn clone(&self) -> EvictionPlan
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 EvictionPlan
impl Debug for EvictionPlan
Source§impl Default for EvictionPlan
impl Default for EvictionPlan
Source§fn default() -> EvictionPlan
fn default() -> EvictionPlan
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EvictionPlan
impl RefUnwindSafe for EvictionPlan
impl Send for EvictionPlan
impl Sync for EvictionPlan
impl Unpin for EvictionPlan
impl UnsafeUnpin for EvictionPlan
impl UnwindSafe for EvictionPlan
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