Trait FlashStore

Source
pub trait FlashStore:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn load_flash(
        &self,
        req: &mut Request,
        depot: &mut Depot,
    ) -> impl Future<Output = Option<Flash>> + Send;
    fn save_flash(
        &self,
        req: &mut Request,
        depot: &mut Depot,
        res: &mut Response,
        flash: Flash,
    ) -> impl Future<Output = ()> + Send;
    fn clear_flash(
        &self,
        depot: &mut Depot,
        res: &mut Response,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

FlashStore is for stores flash messages.

Required Methods§

Source

fn load_flash( &self, req: &mut Request, depot: &mut Depot, ) -> impl Future<Output = Option<Flash>> + Send

Get the flash messages from the store.

Source

fn save_flash( &self, req: &mut Request, depot: &mut Depot, res: &mut Response, flash: Flash, ) -> impl Future<Output = ()> + Send

Save the flash messages to the store.

Source

fn clear_flash( &self, depot: &mut Depot, res: &mut Response, ) -> impl Future<Output = ()> + Send

Clear the flash store.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl FlashStore for CookieStore

Available on crate feature cookie-store only.
Source§

impl FlashStore for SessionStore

Available on crate feature session-store only.