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

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

host

The host field of the URL, probably a domain.

port

The connection port.

path

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

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

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

The URL query string.

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

fragment

The URL fragment.

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

Methods

impl Url

fn parse(input: &str) -> Result<Url, String>

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<Url, String>

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 Display for Url

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

Derived Implementations

impl Debug for Url

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

impl Clone for Url

fn clone(&self) -> Url

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

impl Eq for Url

impl PartialEq for Url

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

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