Struct simplist::Url
[−]
[src]
pub struct Url { /* fields omitted */ }
simple access to a url and its components.
this is an ultra thin wrapper on top of a hyper::Uri
.
examples
let url = "https://hinaria.com".parse()?;
Methods
impl Url
[src]
fn path(&self) -> &str
[src]
returns the path component for this url.
examples
let url: Url = "https://hinaria.com/hello/index.html?q=search".parse()?; assert_eq!(url.path(), "/hello/index.html");
fn scheme(&self) -> Option<&str>
[src]
returns the scheme component for this url.
examples
let url: Url = "https://hinaria.com/hello/index.html?q=search".parse()?; assert_eq!(url.scheme(), Some("https"));
[src]
returns the authority component for this url.
examples
let url: Url = "https://hinaria.com/hello/index.html?q=search".parse()?; assert_eq!(url.authority(), Some("hinaria.com"));
fn host(&self) -> Option<&str>
[src]
returns the host component for this url.
examples
let url: Url = "https://hinaria.com/hello/index.html?q=search".parse()?; assert_eq!(url.host(), Some("hinaria.com"));
fn port(&self) -> Option<u16>
[src]
returns the port component for this url.
examples
let url: Url = "https://hinaria.com/hello/index.html?q=search".parse()?; assert_eq!(url.port(), None);
fn query(&self) -> Option<&str>
[src]
returns the query component for this url.
examples
let url: Url = "https://hinaria.com/hello/index.html?q=search".parse()?; assert_eq!(url.query(), Some("q=search"));
fn is_absolute(&self) -> bool
[src]
returns the is_absolute component for this url.
examples
let url: Url = "https://hinaria.com/hello/index.html?q=search".parse()?; assert_eq!(url.is_absolute(), true);
Trait Implementations
impl Clone for Url
[src]
fn clone(&self) -> Url
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Url
[src]
impl Default for Url
[src]
impl Hash for Url
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for Url
[src]
fn eq(&self, __arg_0: &Url) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Url) -> bool
[src]
This method tests for !=
.
impl Eq for Url
[src]
impl FromStr for Url
[src]
type Err = UriError
The associated error which can be returned from parsing.
fn from_str(string: &str) -> Result<Url, UriError>
[src]
Parses a string s
to return a value of this type. Read more
impl Display for Url
[src]
fn fmt(&self, formatter: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more