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]

[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");

[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"));

[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"));

[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);

[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"));

[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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Url
[src]

[src]

Formats the value using the given formatter.

impl Default for Url
[src]

[src]

Returns the "default value" for a type. Read more

impl Hash for Url
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Url
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for Url
[src]

impl FromStr for Url
[src]

The associated error which can be returned from parsing.

[src]

Parses a string s to return a value of this type. Read more

impl Display for Url
[src]

[src]

Formats the value using the given formatter. Read more

impl Into<Uri> for Url
[src]

[src]

Performs the conversion.

impl IntoUrl for Url
[src]