pub struct TypeWeights {
pub recency: f64,
pub priority: f64,
pub size_penalty: f64,
}Expand description
Weight factors for one media type.
Each factor scales the corresponding component of the eviction score. All weights should be non-negative; they are automatically normalised so their sum is 1.0 before scoring.
Fields§
§recency: f64How much to value recency (freshness) of the entry. Higher = keep recently-accessed entries longer.
priority: f64How much to value the entry’s priority label. Higher = keep high-priority entries longer.
size_penalty: f64How much to penalise large entries. Higher = prefer to evict large entries first.
Trait Implementations§
Source§impl Clone for TypeWeights
impl Clone for TypeWeights
Source§fn clone(&self) -> TypeWeights
fn clone(&self) -> TypeWeights
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 moreimpl Copy for TypeWeights
Source§impl Debug for TypeWeights
impl Debug for TypeWeights
Auto Trait Implementations§
impl Freeze for TypeWeights
impl RefUnwindSafe for TypeWeights
impl Send for TypeWeights
impl Sync for TypeWeights
impl Unpin for TypeWeights
impl UnsafeUnpin for TypeWeights
impl UnwindSafe for TypeWeights
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