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 fn new(config: RedirectHttps) -> Self
pub 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§fn clone(&self) -> RedirectHttpsLayer
fn clone(&self) -> RedirectHttpsLayer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RedirectHttpsLayer
impl Debug for RedirectHttpsLayer
Source§impl Default for RedirectHttpsLayer
impl Default for RedirectHttpsLayer
Source§fn default() -> RedirectHttpsLayer
fn default() -> RedirectHttpsLayer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze 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