#[non_exhaustive]pub enum CachePolicy {
Unset,
NoStore,
Private {
max_age: u32,
},
Public {
max_age: u32,
},
Guests {
max_age: u32,
},
}Expand description
How a route’s pages may be cached. Applied as Cache-Control unless the
handler set one itself.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unset
No Cache-Control from web-net (the default): the handler decides.
NoStore
no-store: never kept (account pages, anything personal).
Private
private, max-age=N: the visitor’s browser only.
Public
public, max-age=N for everyone.
Guests
public, max-age=N for guests, private, no-store for signed-in
visitors: the same page, cached only while it is the same for
everyone. A cache in front of web-net may keep guests’ copies
(Served::cache).
Trait Implementations§
Source§impl Clone for CachePolicy
impl Clone for CachePolicy
impl Copy for CachePolicy
Source§impl Debug for CachePolicy
impl Debug for CachePolicy
Source§impl Default for CachePolicy
impl Default for CachePolicy
impl Eq for CachePolicy
Source§impl PartialEq for CachePolicy
impl PartialEq for CachePolicy
impl StructuralPartialEq for CachePolicy
Auto Trait Implementations§
impl Forget for CachePolicy
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