pub trait PathRewriter {
// Required method
fn rewrite<'a>(&'a mut self, path: &'a str) -> Cow<'a, str>;
// Provided method
fn rewrite_uri<B>(
&mut self,
req: &mut Request<B>,
scheme: &Scheme,
authority: &Authority,
) -> Result<(), HttpError> { ... }
}
Expand description
Represents a rule to rewrite a path /foo/bar/baz
to new one.
A “path” does not include a query. See http::uri::Uri
.
Required Methods§
Provided Methods§
fn rewrite_uri<B>( &mut self, req: &mut Request<B>, scheme: &Scheme, authority: &Authority, ) -> Result<(), HttpError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.