pub enum CachePolicy {
Permanent,
TimeBound {
ttl: Duration,
},
}Expand description
Cache policy attached to an super::executor::ExecuteOptions.
Callers either know their query’s result is permanent under
substrate semantics (At / closed Between) and pass
Permanent, or accept that the result represents a
snapshot of moving state and want TimeBound freshness.
The default is TimeBound { ttl: 5s }.
Variants§
Permanent
Hold until LRU eviction. No staleness deadline beyond capability-index-version mismatch.
TimeBound
TTL-bounded; entry expires after ttl regardless of
the capability-index version.
Trait Implementations§
Source§impl Clone for CachePolicy
impl Clone for CachePolicy
Source§fn clone(&self) -> CachePolicy
fn clone(&self) -> CachePolicy
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 CachePolicy
Source§impl Debug for CachePolicy
impl Debug for CachePolicy
Source§impl Default for CachePolicy
impl Default for CachePolicy
Source§impl PartialEq for CachePolicy
impl PartialEq for CachePolicy
Source§fn eq(&self, other: &CachePolicy) -> bool
fn eq(&self, other: &CachePolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CachePolicy
Auto Trait Implementations§
impl Freeze for CachePolicy
impl RefUnwindSafe for CachePolicy
impl Send for CachePolicy
impl Sync for CachePolicy
impl Unpin for CachePolicy
impl UnsafeUnpin for CachePolicy
impl UnwindSafe for CachePolicy
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