🛎️ One-time notification messages for Axum.
## 🎨 Overview This crate provides one-time notification messages, or flash messages, for `axum` applications. It's built on top of [`tower-sessions`](https://github.com/maxcountryman/tower-sessions), so applications that already use `tower-sessions` can use this crate with minimal setup. For an implementation that uses `axum-extra` cookies, please see [`axum-flash`](https://crates.io/crates/axum-flash); `axum-messages` borrows from that crate, but simplifies the API by leveraging `tower-sessions`. This crate's implementation is inspired by the [Django messages framework](https://docs.djangoproject.com/en/5.0/ref/contrib/messages/). ## 📦 Install To use the crate in your project, add the following to your `Cargo.toml` file: ```toml [dependencies] axum-messages = "0.7.0" ``` ## 🤸 Usage ### Example ```rust use std::net::SocketAddr; use axum::{ response::{IntoResponse, Redirect}, routing::get, Router, }; use axum_messages::{Messages, MessagesManagerLayer}; use tower_sessions::{MemoryStore, SessionManagerLayer}; async fn set_messages_handler(messages: Messages) -> impl IntoResponse { messages .info("Hello, world!") .debug("This is a debug message."); Redirect::to("/read-messages") } async fn read_messages_handler(messages: Messages) -> impl IntoResponse { let messages = messages .into_iter() .map(|message| format!("{}: {}", message.level, message)) .collect::