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 Forget for Location
impl Freeze for Location
impl Move for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnsafeUnpin for Locationwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, Vec<String>> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Vec<String>)>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more