pub struct EvictionContext<'a> {
pub candidates: &'a EvictionCandidates,
pub sizes: &'a HashMap<Hash, u64>,
pub segments: &'a HashMap<Hash, Segment>,
pub total_bytes: u64,
pub target_bytes: u64,
pub budget: u64,
pub cache_bytes: u64,
}Expand description
Everything a policy needs to plan one eviction sweep. The engine assembles
it and never interprets the policy’s semantics — candidates is already
stripped of pins and probe-holds (a deny-listed hash stays a candidate even
when pinned: deny wins over pin), and segments is the generic
hash -> Segment membership the engine tracks with no meaning attached.
Fields§
§candidates: &'a EvictionCandidatesEligible hashes with their last-access Instant (pin- and hold-filtered;
deny-listed hashes stay).
sizes: &'a HashMap<Hash, u64>Whole-store per-hash byte size.
segments: &'a HashMap<Hash, Segment>Generic segment membership the engine tracks (absent = Segment::Main).
total_bytes: u64Effective footprint the sweep is deciding against.
target_bytes: u64Evict down to this many bytes.
budget: u64Maximum releases this sweep.
cache_bytes: u64Configured cache size; a policy sizes its own caps from it (LRU ignores).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for EvictionContext<'a>
impl<'a> RefUnwindSafe for EvictionContext<'a>
impl<'a> Send for EvictionContext<'a>
impl<'a> Sync for EvictionContext<'a>
impl<'a> Unpin for EvictionContext<'a>
impl<'a> UnsafeUnpin for EvictionContext<'a>
impl<'a> UnwindSafe for EvictionContext<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.