pub struct CachePolicy {
pub default_ttl: Duration,
pub respect_headers: bool,
pub cache_status_override: Option<Vec<u16>>,
}
Expand description
Defines the caching policy for storing and retrieving responses.
Fields§
§default_ttl: Duration
Defines the caching policy for storing and retrieving responses.
respect_headers: bool
Determines whether cache expiration should respect HTTP headers.
cache_status_override: Option<Vec<u16>>
Optional override for caching specific HTTP status codes.
- If
None
, only success responses (2xx
) are cached. - If
Some(Vec<u16>)
, only the specified status codes are cached.
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CachePolicy
impl Debug 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 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