inertia_rust/temporary_session.rs
use serde::Serialize;
use serde_json::{Map, Value};
/// `InertiaTemporarySession` struct contains data that InertiaMiddleware will try to extract
/// from the request and merge with shared props.
///
/// You must inject it by yourself by a second middleware, which gets these information from
/// your framework sessions manager.
#[derive(Clone, Serialize, Debug)]
pub struct InertiaTemporarySession {
pub errors: Option<Map<String, Value>>,
pub prev_req_url: String,
}
impl Default for InertiaTemporarySession {
fn default() -> Self {
InertiaTemporarySession {
errors: None,
prev_req_url: "/".to_string(),
}
}
}
pub struct InertiaSessionToReflash(pub InertiaTemporarySession);