pub struct ForceHttps { /* private fields */ }
Available on crate feature
force-https
only.Expand description
Middleware for force redirect to http uri.
Implementations§
Source§impl ForceHttps
impl ForceHttps
Sourcepub fn new() -> ForceHttps
pub fn new() -> ForceHttps
Create new ForceHttps
middleware.
Sourcepub fn https_port(self, port: u16) -> ForceHttps
pub fn https_port(self, port: u16) -> ForceHttps
Specify https port.
Sourcepub fn skipper(self, skipper: impl Skipper) -> ForceHttps
pub fn skipper(self, skipper: impl Skipper) -> ForceHttps
Uses a closure to determine if a request should be redirect.
Trait Implementations§
Source§impl Default for ForceHttps
impl Default for ForceHttps
Source§fn default() -> ForceHttps
fn default() -> ForceHttps
Returns the “default value” for a type. Read more
Source§impl Handler for ForceHttps
impl Handler for ForceHttps
Source§fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
ForceHttps: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
depot: &'life2 mut Depot,
res: &'life3 mut Response,
ctrl: &'life4 mut FlowCtrl,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
ForceHttps: 'async_trait,
Handle http request.
Source§fn arc(self) -> ArcHandlerwhere
Self: Sized,
fn arc(self) -> ArcHandlerwhere
Self: Sized,
Wrap to
ArcHandler
.Source§fn hoop<H>(self, hoop: H) -> HoopedHandler
fn hoop<H>(self, hoop: H) -> HoopedHandler
Hoop this handler with middleware.
Auto Trait Implementations§
impl Freeze for ForceHttps
impl !RefUnwindSafe for ForceHttps
impl Send for ForceHttps
impl Sync for ForceHttps
impl Unpin for ForceHttps
impl !UnwindSafe for ForceHttps
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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