PathRewriter

Trait PathRewriter 

Source
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,
        request: &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§

Source

fn rewrite<'a>(&'a mut self, path: &'a str) -> Cow<'a, str>

Provided Methods§

Source

fn rewrite_uri<B>( &mut self, request: &mut Request<B>, scheme: &Scheme, authority: &Authority, ) -> Result<(), HttpError>

§Errors

When the rewritten path is invalid

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.

Implementors§