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".
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)