diff options
author | Richard Walters <rwalters@digitalstirling.com> | 2020-10-13 16:46:26 -0700 |
---|---|---|
committer | Richard Walters <rwalters@digitalstirling.com> | 2020-10-13 16:46:26 -0700 |
commit | d4606bbc99b6f14f2951933fcb6bab5d9cd1278e (patch) | |
tree | 83ccc8e2e269a148e6db485ef6bb35b5d46d1de8 /src/context.rs | |
parent | 9feb8f2134ebf404c84b7b0614621a6251f937f6 (diff) |
Add documentation (Rust)
Diffstat (limited to 'src/context.rs')
-rw-r--r-- | src/context.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/context.rs b/src/context.rs index bbc6613..bb6667e 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1,13 +1,41 @@ +/// This enumerates the various places where an error might occur parsing a +/// URI. #[derive(Debug, Clone, Copy, PartialEq)] pub enum Context { + /// This is the fragment of the URI, such as `#baz` in + /// `http://www.example.com/foo?bar#baz`. Fragment, + + /// This is the host name of the URI, such as `www.example.com` in + /// `http://www.example.com/foo?bar#baz`. Host, + + /// This is the IPv4 portion of the IPv6 host name in the URI, such as + /// `1.2.3.4` in `http://[::ffff:1.2.3.4]/foo?bar#baz`. Ipv4Address, + + /// This is the IPv6 host name in the URI, such as + /// `::ffff:1.2.3.4` in `http://[::ffff:1.2.3.4]/foo?bar#baz`. Ipv6Address, + + /// This is the `IPvFuture` host name in the URI, such as + /// `v7.aB` in `http://[v7.aB]/foo?bar#baz`. IpvFuture, + + /// This is the path of the URI, such as `/foo` in + /// `http://www.example.com/foo?bar#baz`. Path, + + /// This is the query of the URI, such as `?bar` in + /// `http://www.example.com/foo?bar#baz`. Query, + + /// This is the scheme of the URI, such as `http` in + /// `http://www.example.com/foo?bar#baz`. Scheme, + + /// This is the scheme of the URI, such as `nobody` in + /// `http://nobody@www.example.com/foo?bar#baz`. Userinfo, } |