pub struct FlashLayer { /* private fields */ }Expand description
Tower Layer that enables cookie-based flash messages for a router.
On each request the layer reads the signed flash cookie and populates
the Flash extractor. On response it either writes a new
signed cookie (when messages were queued) or removes the existing one (when
messages were consumed via Flash::messages).
§Cookie details
- Name:
flash - Signed with HMAC using the application
Key Max-Age: 300 seconds (5 minutes)- Path,
Secure,HttpOnly, andSameSiteattributes come fromCookieConfig
Implementations§
Source§impl FlashLayer
impl FlashLayer
Sourcepub fn new(config: &CookieConfig, key: &Key) -> Self
pub fn new(config: &CookieConfig, key: &Key) -> Self
Create a new FlashLayer from a cookie configuration and signing key.
Trait Implementations§
Source§impl Clone for FlashLayer
impl Clone for FlashLayer
Auto Trait Implementations§
impl Freeze for FlashLayer
impl RefUnwindSafe for FlashLayer
impl Send for FlashLayer
impl Sync for FlashLayer
impl Unpin for FlashLayer
impl UnsafeUnpin for FlashLayer
impl UnwindSafe for FlashLayer
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