pub struct CacheConfig<'a> {
pub app_dir_name: &'a str,
pub env_override_var: &'a str,
pub revalidate_after: Duration,
pub key: &'a str,
}Expand description
How one consumer’s cache is named, keyed, and aged.
Fields§
§app_dir_name: &'a strPath under the platform cache directory (e.g. tapesctl/cassettes).
env_override_var: &'a strEnvironment variable that overrides where the cache lives. Set by tests, and useful for pinning the location in CI.
revalidate_after: DurationHow long a cached surface is used without asking the server about it.
Cassette sets change when an operator redeploys, which is rare next to
how often a CLI runs; tapesctl passes ten minutes, which keeps --help
instant through a working session while still picking up a new cassette
without anyone clearing a cache.
key: &'a strThe cache key: the server’s base URL, as the consumer’s client renders it.
Trait Implementations§
Source§impl<'a> Clone for CacheConfig<'a>
impl<'a> Clone for CacheConfig<'a>
Source§fn clone(&self) -> CacheConfig<'a>
fn clone(&self) -> CacheConfig<'a>
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<'a> Copy for CacheConfig<'a>
Auto Trait Implementations§
impl<'a> Freeze for CacheConfig<'a>
impl<'a> RefUnwindSafe for CacheConfig<'a>
impl<'a> Send for CacheConfig<'a>
impl<'a> Sync for CacheConfig<'a>
impl<'a> Unpin for CacheConfig<'a>
impl<'a> UnsafeUnpin for CacheConfig<'a>
impl<'a> UnwindSafe for CacheConfig<'a>
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