pub struct ResponseCachePolicy {
pub visibility: CacheVisibility,
pub max_age: Option<Duration>,
pub vary: Vec<HeaderName>,
}Expand description
Declarative HTTP response caching policy, distinct from application data caching.
Fields§
§visibility: CacheVisibilityCache visibility.
max_age: Option<Duration>Optional freshness lifetime.
vary: Vec<HeaderName>Request headers that vary the selected representation.
Implementations§
Source§impl ResponseCachePolicy
impl ResponseCachePolicy
Sourcepub fn private(max_age: Duration) -> SoapResult<Self>
pub fn private(max_age: Duration) -> SoapResult<Self>
Creates a private response cache policy with non-zero freshness.
Sourcepub fn public(max_age: Duration) -> SoapResult<Self>
pub fn public(max_age: Duration) -> SoapResult<Self>
Creates a shared response cache policy with non-zero freshness.
Sourcepub fn vary(self, vary: Vec<HeaderName>) -> Self
pub fn vary(self, vary: Vec<HeaderName>) -> Self
Sets request headers included in the cache key.
Sourcepub fn validate(&self) -> SoapResult<()>
pub fn validate(&self) -> SoapResult<()>
Validates cache semantics after direct public-field mutation.
Trait Implementations§
Source§impl Clone for ResponseCachePolicy
impl Clone for ResponseCachePolicy
Source§fn clone(&self) -> ResponseCachePolicy
fn clone(&self) -> ResponseCachePolicy
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 moreSource§impl Debug for ResponseCachePolicy
impl Debug for ResponseCachePolicy
impl Eq for ResponseCachePolicy
Source§impl PartialEq for ResponseCachePolicy
impl PartialEq for ResponseCachePolicy
impl StructuralPartialEq for ResponseCachePolicy
Auto Trait Implementations§
impl Freeze for ResponseCachePolicy
impl RefUnwindSafe for ResponseCachePolicy
impl Send for ResponseCachePolicy
impl Sync for ResponseCachePolicy
impl Unpin for ResponseCachePolicy
impl UnsafeUnpin for ResponseCachePolicy
impl UnwindSafe for ResponseCachePolicy
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