pub trait RedirectExt: Sealed + Sized {
// Required methods
fn route(name: &str, params: &[&dyn Display]) -> Result<Self>;
fn intended(session: &Session, fallback: &str) -> Self;
}Expand description
Named-route and intended-page redirects on axum’s Redirect (in the
prelude):
// To a named route, with its parameters:
let to_product = Redirect::route("products.show", &[&id])?;
// Where a guard sent the user from (e.g. before logging in), else /dashboard:
let back = Redirect::intended(&session, "/dashboard");The trait is sealed: it’s implemented for Redirect only, so it can grow.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".