pub struct RoundRobinReplacement { /* private fields */ }Expand description
Choose cache entries to replace in a round-robin order.
When considering n items to potentially replace, first it will replace the
0th item, and then next time it will replace the 1st item, …, then the
n-1th item, then the 0th item, etc…
This replacement policy is simple and fast, but can suffer from harmonics.
Trait Implementations§
Source§impl Clone for RoundRobinReplacement
impl Clone for RoundRobinReplacement
Source§fn clone(&self) -> RoundRobinReplacement
fn clone(&self) -> RoundRobinReplacement
Returns a duplicate of the value. Read more
1.0.0 · 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 RoundRobinReplacement
impl Debug for RoundRobinReplacement
Source§impl Default for RoundRobinReplacement
impl Default for RoundRobinReplacement
Source§fn default() -> RoundRobinReplacement
fn default() -> RoundRobinReplacement
Returns the “default value” for a type. Read more
Source§impl Hash for RoundRobinReplacement
impl Hash for RoundRobinReplacement
Source§impl Ord for RoundRobinReplacement
impl Ord for RoundRobinReplacement
Source§fn cmp(&self, other: &RoundRobinReplacement) -> Ordering
fn cmp(&self, other: &RoundRobinReplacement) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for RoundRobinReplacement
impl PartialEq for RoundRobinReplacement
Source§impl PartialOrd for RoundRobinReplacement
impl PartialOrd for RoundRobinReplacement
Source§impl<V, C> Replacement<V, C> for RoundRobinReplacementwhere
C: Capacity,
impl<V, C> Replacement<V, C> for RoundRobinReplacementwhere
C: Capacity,
Source§fn choose_for_replacement<'a>(
&mut self,
candidates: impl ExactSizeIterator<Item = (usize, &'a V)>,
) -> usizewhere
V: 'a,
fn choose_for_replacement<'a>(
&mut self,
candidates: impl ExactSizeIterator<Item = (usize, &'a V)>,
) -> usizewhere
V: 'a,
Choose which of the given cache entries will be replaced.
impl Eq for RoundRobinReplacement
impl StructuralPartialEq for RoundRobinReplacement
Auto Trait Implementations§
impl Freeze for RoundRobinReplacement
impl RefUnwindSafe for RoundRobinReplacement
impl Send for RoundRobinReplacement
impl Sync for RoundRobinReplacement
impl Unpin for RoundRobinReplacement
impl UnwindSafe for RoundRobinReplacement
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