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§

source

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

Provided Methods§

source

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

Implementors§