pub trait Entry {
type Rank: Ord;
// Required methods
fn rank(&self) -> Self::Rank;
fn accessed(&self) -> bool;
}Expand description
The Second Chance implementation works with a set of entries; each entry keeps track of a value that represents its rank in the set, and a single boolean flag, to determine whether the entry has been accessed since the last time it was scanned (and move up in rank).
Required Associated Types§
Sourcetype Rank: Ord
type Rank: Ord
The Second Chance policy maintains an implicit list of entries. Entries in the list are ordered by sorting by Rank; a lower rank comes earlier in the list of removal victims.
For files, this would be SystemTime or FileTime: files
with more recent modification times come later in the eviction
queue.