Struct iron::Url [] [src]

pub struct Url {
    pub scheme: String,
    pub host: Host,
    pub port: u16,
    pub path: Vec<String>,
    pub username: Option<String>,
    pub password: Option<String>,
    pub query: Option<String>,
    pub fragment: Option<String>,
}

HTTP/HTTPS URL type for Iron.

Fields

scheme: String

The lower-cased scheme of the URL, typically "http" or "https".

host: Host

The host field of the URL, probably a domain.

port: u16

The connection port.

path: Vec<String>

The URL path, the resource to be accessed.

A non-empty vector encoding the parts of the URL path. Empty entries of "" correspond to trailing slashes.

username: Option<String>

The URL username field, from the userinfo section of the URL.

None if the @ character was not part of the input OR if a blank username was provided. Otherwise, a non-empty string.

password: Option<String>

The URL password field, from the userinfo section of the URL.

None if the @ character was not part of the input OR if a blank password was provided. Otherwise, a non-empty string.

query: Option<String>

The URL query string.

None if the ? character was not part of the input. Otherwise, a possibly empty, percent encoded string.

fragment: Option<String>

The URL fragment.

None if the # character was not part of the input. Otherwise, a possibly empty, percent encoded string.

Methods

impl Url
[src]

fn parse(input: &str) -> Result<UrlString>

Create a URL from a string.

The input must be a valid URL with a special scheme for this to succeed.

HTTP and HTTPS are special schemes.

See: http://url.spec.whatwg.org/#special-scheme

fn from_generic_url(raw_url: Url) -> Result<UrlString>

Create a Url from a rust-url Url.

fn into_generic_url(self) -> Url

Create a rust-url Url from a Url.

Trait Implementations

impl Debug for Url
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for Url
[src]

fn clone(&self) -> Url

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Eq for Url
[src]

impl PartialEq for Url
[src]

fn eq(&self, __arg_0: &Url) -> bool

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

fn ne(&self, __arg_0: &Url) -> bool

This method tests for !=.

impl Display for Url
[src]

fn fmt(&self, formatter: &mut Formatter) -> Result

Formats the value using the given formatter.