pub struct CacheMetaDefaults { /* private fields */ }
Expand description
The default settings to generate CacheMeta
Implementations§
Source§impl CacheMetaDefaults
impl CacheMetaDefaults
Sourcepub const fn new(
fresh_sec_fn: FreshSecByStatusFn,
stale_while_revalidate_sec: u32,
stale_if_error_sec: u32,
) -> Self
pub const fn new( fresh_sec_fn: FreshSecByStatusFn, stale_while_revalidate_sec: u32, stale_if_error_sec: u32, ) -> Self
Create a new CacheMetaDefaults
Sourcepub fn fresh_sec(&self, resp_status: StatusCode) -> Option<u32>
pub fn fresh_sec(&self, resp_status: StatusCode) -> Option<u32>
Return the default TTL for the given StatusCode
None
: do no cache this code.
Sourcepub fn serve_stale_while_revalidate_sec(&self) -> u32
pub fn serve_stale_while_revalidate_sec(&self) -> u32
The default SWR seconds
Sourcepub fn serve_stale_if_error_sec(&self) -> u32
pub fn serve_stale_if_error_sec(&self) -> u32
The default SIE seconds
Auto Trait Implementations§
impl Freeze for CacheMetaDefaults
impl RefUnwindSafe for CacheMetaDefaults
impl Send for CacheMetaDefaults
impl Sync for CacheMetaDefaults
impl Unpin for CacheMetaDefaults
impl UnwindSafe for CacheMetaDefaults
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