pub struct Location {
pub url: String,
pub protocol: String,
pub host: String,
pub hostname: String,
pub port: String,
pub hash: String,
pub query: String,
pub query_map: BTreeMap<String, Vec<String>>,
pub origin: String,
}Expand description
Information about the URL.
Everything has been percent decoded (%20 -> etc).
Fields§
§url: StringThe full URL (location.href) without the hash, percent-decoded.
Example: "http://www.example.com:80/index.html?foo=bar".
protocol: Stringlocation.protocol
Example: "http:".
host: Stringlocation.host
Example: "example.com:80".
hostname: Stringlocation.hostname
Example: "example.com".
port: Stringlocation.port
Example: "80".
hash: StringThe “#fragment” part of “www.example.com/index.html?query#fragment”.
Note that the leading # is included in the string.
Also known as “hash-link” or “anchor”.
query: StringThe “query” part of “www.example.com/index.html?query#fragment”.
Note that the leading ? is NOT included in the string.
Use Self::query_map to get the parsed version of it.
query_map: BTreeMap<String, Vec<String>>The parsed “query” part of “www.example.com/index.html?query#fragment”.
“foo=hello&bar%20&foo=world” is parsed as {"bar ": [""], "foo": ["hello", "world"]}
origin: Stringlocation.origin
Example: "http://www.example.com:80".