pub struct SessionMessageStore { /* private fields */ }
Expand description
A session-based implementation of flash messages.
SessionMessageStore
uses the session machinery provided by actix-session
to store and retrieve FlashMessage
s.
Use either SessionMessageStore::default
or SessionMessageStore::default
to build an instance of SessionMessageStore
.
§Disclaimer
Be careful: you need to wrap your application in an additional middleware,
in addition to FlashMessagesFramework
, that provides persistence for the
session data.
actix-session
provides a cookie-based implementation of sessions via
actix_session::CookieSession
.
Alternatively, you can use RedisSession
from actix-redis
.
Flash messages will not work if you fail to mount a storage backend for your sessions.
You can find examples of application using SessionMessageStore
on GitHub:
using both
cookie-based sessions and
Redis-based sessions.
Implementations§
Source§impl SessionMessageStore
impl SessionMessageStore
Sourcepub fn new(key: String) -> Self
pub fn new(key: String) -> Self
Build a new SessionMessageStore
and specify which key should be used
to store outgoing flash messages in the session map.
Trait Implementations§
Source§impl Clone for SessionMessageStore
impl Clone for SessionMessageStore
Source§fn clone(&self) -> SessionMessageStore
fn clone(&self) -> SessionMessageStore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more