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§
- Append
Prefix - Appends a prefix.
- Append
Suffix - Appends a suffix.
- Func
- Converts the
path
by a function. - Identity
- Identity function, that is, this returns the
path
as is. - Regex
All RegexAll(re, new)
replaces all matchesre
withnew
.- RegexN
RegexN(re, new, n)
replaces firstn
matchesre
withnew
.- Replace
All ReplaceAll(old, new)
replaces all matchesold
withnew
.- ReplaceN
ReplaceN(old, new, n)
replaces firstn
matchesold
withnew
.- Static
- Returns
self.0
regardless what thepath
is. - Trim
Prefix - Trims a prefix if exists.
- Trim
Suffix - Trims a suffix if exists.
Traits§
- Path
Rewriter - Represents a rule to rewrite a path
/foo/bar/baz
to new one.