Module rewrite

Source
Expand description

A PathRewriter instance defines a rule to rewrite the request path.

A “path” does not include a query. See http::uri::Uri.

Structs§

AppendPrefix
Appends a prefix.
AppendSuffix
Appends a suffix.
Func
Converts the path by a function.
Identity
Identity function, that is, this returns the path as is.
RegexAll
RegexAll(re, new) replaces all matches re with new.
RegexN
RegexN(re, new, n) replaces first n matches re with new.
ReplaceAll
ReplaceAll(old, new) replaces all matches old with new.
ReplaceN
ReplaceN(old, new, n) replaces first n matches old with new.
Static
Returns self.0 regardless what the path is.
TrimPrefix
Trims a prefix if exists.
TrimSuffix
Trims a suffix if exists.

Traits§

PathRewriter
Represents a rule to rewrite a path /foo/bar/baz to new one.