pub struct CachePolicy {
pub directory: PathBuf,
pub ttl: Duration,
pub max_stale: Duration,
}Expand description
Optional persistent subscription cache.
Files contain proxy credentials, but never the subscription URL. Keep the
directory private and outside source control. Each write atomically replaces
the previous file; on Unix, new directories and files have owner-only
permissions (0700 and 0600). Existing directory permissions are preserved.
Missing, invalid, and expired files are cache misses; other filesystem errors
are returned to the caller instead of silently hiding configuration problems.
Fields§
§directory: PathBufDirectory in which hashed subscription keys identify cache files.
ttl: DurationHow long a successful download or HTTP revalidation remains fresh.
max_stale: DurationAdditional time after ttl during which stale fallback is permitted.
Zero disables stale fallback.
Implementations§
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 moreAuto 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