pub struct ExtendedTtlPolicy {
pub idle_ttl_ms: Option<u64>,
pub stale_serve_ms: Option<u64>,
pub jitter_pct: u8,
}Expand description
Extended TTL configuration that augments a base [BlobCachePolicy].
Construct via field literal or ExtendedTtlPolicy::off. All three knobs
are independently optional / zero-able; Self::is_active reports whether
any of them affects expiry decisions.
Fields§
§idle_ttl_ms: Option<u64>Sliding expiry: if the entry has not been accessed within this many
milliseconds, it is considered expired even if hard TTL has not passed.
None disables idle expiry.
stale_serve_ms: Option<u64>Stale-while-revalidate window in milliseconds. After the hard expiry,
the entry can still be served as ExpiryDecision::Stale for this
many milliseconds before becoming ExpiryDecision::Expired.
None disables the SWR window (hard expiry → immediate Expired).
jitter_pct: u8Jitter percentage applied at insert time, clamped to 0..=100.
0 disables jitter; values above 100 are treated as 100.
Implementations§
Source§impl ExtendedTtlPolicy
impl ExtendedTtlPolicy
Sourcepub fn off() -> ExtendedTtlPolicy
pub fn off() -> ExtendedTtlPolicy
Returns the no-op extended policy: no idle, no SWR, no jitter.
In this state, EffectiveExpiry::compute reduces to a pure
hard-expiry check.
Trait Implementations§
Source§impl Clone for ExtendedTtlPolicy
impl Clone for ExtendedTtlPolicy
Source§fn clone(&self) -> ExtendedTtlPolicy
fn clone(&self) -> ExtendedTtlPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExtendedTtlPolicy
impl Debug for ExtendedTtlPolicy
Source§impl Default for ExtendedTtlPolicy
impl Default for ExtendedTtlPolicy
Source§fn default() -> ExtendedTtlPolicy
fn default() -> ExtendedTtlPolicy
Source§impl PartialEq for ExtendedTtlPolicy
impl PartialEq for ExtendedTtlPolicy
Source§fn eq(&self, other: &ExtendedTtlPolicy) -> bool
fn eq(&self, other: &ExtendedTtlPolicy) -> bool
self and other values to be equal, and is used by ==.impl Copy for ExtendedTtlPolicy
impl Eq for ExtendedTtlPolicy
impl StructuralPartialEq for ExtendedTtlPolicy
Auto Trait Implementations§
impl Freeze for ExtendedTtlPolicy
impl RefUnwindSafe for ExtendedTtlPolicy
impl Send for ExtendedTtlPolicy
impl Sync for ExtendedTtlPolicy
impl Unpin for ExtendedTtlPolicy
impl UnsafeUnpin for ExtendedTtlPolicy
impl UnwindSafe for ExtendedTtlPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request