pub type FlashMessage<'a> = Flash<&'a CookieJar<'a>>;
Expand description
Type alias to retrieve Flash
messages from a request.
§Flash Cookie
A FlashMessage
holds the parsed contents of the flash cookie. As long as
there is a flash cookie present (set by the Flash
Responder
), a
FlashMessage
request guard will succeed.
The flash cookie is cleared if either the kind()
or message()
method is
called. If neither method is called, the flash cookie is not cleared.
Aliased Type§
struct FlashMessage<'a> { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl<'r> FromRequest<'r> for FlashMessage<'r>
impl<'r> FromRequest<'r> for FlashMessage<'r>
Retrieves a flash message from a flash cookie. If there is no flash cookie,
or if the flash cookie is malformed, an empty Err
is returned.
The suggested use is through an Option
and the FlashMessage
type alias
in request
: Option<FlashMessage>
.