#[non_exhaustive]pub struct Parsed<'a> {
pub path: Cow<'a, [u8]>,
pub args: Option<&'a [u8]>,
}Expand description
The result of parsing an origin-form request target.
path and args correspond to the initial values nginx exposes through
its $uri and $args variables.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.path: Cow<'a, [u8]>The normalized path, corresponding to nginx’s $uri variable before
any later rewrite processing. The query string is excluded.
/../ segments are removed by resolving the preceding segment, and
percent-encoded bytes are decoded. For example,
/a/../hello%20world becomes /hello world.
A path that needs no normalization borrows the input unchanged
(Cow::Borrowed, no allocation); a normalized path is owned
(Cow::Owned).
args: Option<&'a [u8]>The query string, corresponding to nginx’s initial $args variable:
the bytes after the first ?, up to a # fragment or the end of the
target. It always borrows the input and is not normalized.
None means nginx found no query arguments; this includes a trailing
? with nothing after it ("/a?"). Some(b"") marks the empty query
before a fragment in a target such as "/a?#f".