pub struct NormalizePathLayer { /* private fields */ }Expand description
重新导出 tower-http 的常用中间件
Layer that applies NormalizePath which normalizes paths.
See the module docs for more details.
Implementations§
Source§impl NormalizePathLayer
impl NormalizePathLayer
Sourcepub fn trim_trailing_slash() -> NormalizePathLayer
pub fn trim_trailing_slash() -> NormalizePathLayer
Create a new NormalizePathLayer.
Any trailing slashes from request paths will be removed. For example, a request with /foo/
will be changed to /foo before reaching the inner service.
Sourcepub fn append_trailing_slash() -> NormalizePathLayer
pub fn append_trailing_slash() -> NormalizePathLayer
Create a new NormalizePathLayer.
Request paths without trailing slash will be appended with a trailing slash. For example, a request with /foo
will be changed to /foo/ before reaching the inner service.
Trait Implementations§
Source§impl Clone for NormalizePathLayer
impl Clone for NormalizePathLayer
Source§fn clone(&self) -> NormalizePathLayer
fn clone(&self) -> NormalizePathLayer
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 NormalizePathLayer
impl Debug for NormalizePathLayer
Source§impl<S> Layer<S> for NormalizePathLayer
impl<S> Layer<S> for NormalizePathLayer
Source§type Service = NormalizePath<S>
type Service = NormalizePath<S>
The wrapped service
impl Copy for NormalizePathLayer
Auto Trait Implementations§
impl Freeze for NormalizePathLayer
impl RefUnwindSafe for NormalizePathLayer
impl Send for NormalizePathLayer
impl Sync for NormalizePathLayer
impl Unpin for NormalizePathLayer
impl UnsafeUnpin for NormalizePathLayer
impl UnwindSafe for NormalizePathLayer
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