pub struct RandomReplacement<R = StdRng> { /* private fields */ }Expand description
Choose a random cache entry to replace.
When considering n items to potentially replace, choose one at random.
Requires the "rand" feature to be enabled.
Implementations§
Trait Implementations§
Source§impl<R: Clone> Clone for RandomReplacement<R>
impl<R: Clone> Clone for RandomReplacement<R>
Source§fn clone(&self) -> RandomReplacement<R>
fn clone(&self) -> RandomReplacement<R>
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<R: Debug> Debug for RandomReplacement<R>
impl<R: Debug> Debug for RandomReplacement<R>
Source§impl Default for RandomReplacement<StdRng>
Available on crate feature rand only.
impl Default for RandomReplacement<StdRng>
Available on crate feature
rand only.Source§impl<R: Hash> Hash for RandomReplacement<R>
impl<R: Hash> Hash for RandomReplacement<R>
Source§impl<R: Ord> Ord for RandomReplacement<R>
impl<R: Ord> Ord for RandomReplacement<R>
Source§fn cmp(&self, other: &RandomReplacement<R>) -> Ordering
fn cmp(&self, other: &RandomReplacement<R>) -> 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<R: PartialEq> PartialEq for RandomReplacement<R>
impl<R: PartialEq> PartialEq for RandomReplacement<R>
Source§impl<R: PartialOrd> PartialOrd for RandomReplacement<R>
impl<R: PartialOrd> PartialOrd for RandomReplacement<R>
Source§impl<V, C, R> Replacement<V, C> for RandomReplacement<R>
Available on crate feature rand only.
impl<V, C, R> Replacement<V, C> for RandomReplacement<R>
Available on crate feature
rand only.impl<R: Eq> Eq for RandomReplacement<R>
impl<R> StructuralPartialEq for RandomReplacement<R>
Auto Trait Implementations§
impl<R> Freeze for RandomReplacement<R>where
R: Freeze,
impl<R> RefUnwindSafe for RandomReplacement<R>where
R: RefUnwindSafe,
impl<R> Send for RandomReplacement<R>where
R: Send,
impl<R> Sync for RandomReplacement<R>where
R: Sync,
impl<R> Unpin for RandomReplacement<R>where
R: Unpin,
impl<R> UnwindSafe for RandomReplacement<R>where
R: UnwindSafe,
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