pub struct RedirectHttpsLayer { /* private fields */ }Expand description
Tower Layer that redirects HTTP requests to HTTPS.
Apply with Axum’s .layer() call. Use RedirectHttpsLayer::default() for
a 308 redirect on standard ports, or RedirectHttpsLayer::new() to
supply a custom RedirectHttps configuration.
§Examples
use axum::{routing::get, Router};
use rune_axum_redirect_https::RedirectHttpsLayer;
let app: Router = Router::new()
.route("/", get(|| async { "ok" }))
.layer(RedirectHttpsLayer::default());Implementations§
Source§impl RedirectHttpsLayer
impl RedirectHttpsLayer
Sourcepub const fn new(config: RedirectHttps) -> Self
pub const fn new(config: RedirectHttps) -> Self
Creates a RedirectHttpsLayer from a custom RedirectHttps configuration.
Trait Implementations§
Source§impl Clone for RedirectHttpsLayer
impl Clone for RedirectHttpsLayer
Source§impl Debug for RedirectHttpsLayer
impl Debug for RedirectHttpsLayer
Source§impl Default for RedirectHttpsLayer
impl Default for RedirectHttpsLayer
Auto Trait Implementations§
impl Forget for RedirectHttpsLayer
impl Freeze for RedirectHttpsLayer
impl Move for RedirectHttpsLayer
impl RefUnwindSafe for RedirectHttpsLayer
impl Send for RedirectHttpsLayer
impl Sync for RedirectHttpsLayer
impl Unpin for RedirectHttpsLayer
impl UnsafeUnpin for RedirectHttpsLayer
impl UnwindSafe for RedirectHttpsLayer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more