pub trait FlashMessageStore: Send + Sync {
    fn load(
        &self,
        request: &HttpRequest
    ) -> Result<Vec<FlashMessage>, LoadError>; fn store(
        &self,
        messages: &[FlashMessage],
        request: HttpRequest,
        response: &mut ResponseHead
    ) -> Result<(), StoreError>; }
Expand description

The interface to retrieve and dispatch flash messages.

actix-web-flash-messages provides two implementation of flash messages:

  • a cookie-based one, CookieMessageStore, using a signed cookie to store and retrieve messages;
  • a session-based one, SessionMessageStore, which attaches flash messages to the current session.

You can provide your own custom message store backend by implementing this trait.

Required Methods

Extract flash messages from an incoming request.

Attach flash messages to an outgoing response.

Implementors