pub enum CacheReuseDecision {
Reuse,
StampFresh,
DiscardAndRecompute,
}Expand description
What to do with a cache encountered at the reuse boundary, produced by
decide_cache_reuse. The policy is fail-closed: it never blesses a
cache whose KV cannot be proven compatible with an authoritative identity.
Variants§
Reuse
Cache KV is provably compatible with an authoritative expected identity — reuse it as-is.
StampFresh
Cache is empty and carries no stamp, and an authoritative expected identity is available. Stamp it and keep the (empty) cache; prefill will populate it under that identity.
DiscardAndRecompute
The cache’s KV cannot be proven compatible. This covers a stamp mismatch, an unstamped but populated cache (produced under an unknown identity), and the absence of any authoritative expected identity. Discard the KV and recompute; stamp with the authoritative identity if one is available.
Trait Implementations§
Source§impl Clone for CacheReuseDecision
impl Clone for CacheReuseDecision
Source§fn clone(&self) -> CacheReuseDecision
fn clone(&self) -> CacheReuseDecision
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 CacheReuseDecision
impl Debug for CacheReuseDecision
Source§impl PartialEq for CacheReuseDecision
impl PartialEq for CacheReuseDecision
Source§fn eq(&self, other: &CacheReuseDecision) -> bool
fn eq(&self, other: &CacheReuseDecision) -> bool
self and other values to be equal, and is used by ==.impl Copy for CacheReuseDecision
impl Eq for CacheReuseDecision
impl StructuralPartialEq for CacheReuseDecision
Auto Trait Implementations§
impl Freeze for CacheReuseDecision
impl RefUnwindSafe for CacheReuseDecision
impl Send for CacheReuseDecision
impl Sync for CacheReuseDecision
impl Unpin for CacheReuseDecision
impl UnsafeUnpin for CacheReuseDecision
impl UnwindSafe for CacheReuseDecision
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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