pub struct Adjustment {
pub kind: AdjustmentKind,
pub recommended_capacity: usize,
pub ttl_extend: Duration,
pub ttl_reduce: Duration,
pub observed_hit_rate: f64,
}Expand description
A recommended adjustment emitted by [AdaptivePolicy::evaluate].
Fields§
§kind: AdjustmentKindWhat kind of change is recommended.
recommended_capacity: usizeRecommended new cache capacity.
ttl_extend: DurationRecommended TTL delta (positive = extend, negative = reduce).
For AdjustmentKind::Grow this is + ttl_extension.
For AdjustmentKind::Shrink this is - ttl_reduction (represented
as a negative duration is awkward, so we split into two fields).
ttl_reduce: DurationTTL reduction (only non-zero for AdjustmentKind::Shrink).
observed_hit_rate: f64The rolling hit rate that triggered this adjustment.
Trait Implementations§
Source§impl Clone for Adjustment
impl Clone for Adjustment
Source§fn clone(&self) -> Adjustment
fn clone(&self) -> Adjustment
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 moreAuto Trait Implementations§
impl Freeze for Adjustment
impl RefUnwindSafe for Adjustment
impl Send for Adjustment
impl Sync for Adjustment
impl Unpin for Adjustment
impl UnsafeUnpin for Adjustment
impl UnwindSafe for Adjustment
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