Types/fns concerning URLs (see RFC 3986)

Type Query

type Query = ~[(~str, ~str)]

Implementation of ::std::clone::Clone for Url

Automatically derived.

Method clone

fn clone(&self) -> Url

Implementation of ::std::cmp::Eq for Url

Automatically derived.

Method eq

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

Method ne

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

Implementation of ::std::clone::Clone for UserInfo

Automatically derived.

Method clone

fn clone(&self) -> UserInfo

Implementation of ::std::cmp::Eq for UserInfo

Automatically derived.

Method eq

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

Method ne

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

Implementation for Url

Method new

fn new(scheme: ~str, user: Option<UserInfo>, host: ~str, port: Option<~str>,
       path: ~str, query: Query, fragment: Option<~str>) -> Url

Implementation for UserInfo

Method new

fn new(user: ~str, pass: Option<~str>) -> UserInfo

Implementation of ::std::clone::Clone for Input

Automatically derived.

Method clone

fn clone(&self) -> Input

Implementation of ::std::cmp::Eq for Input

Automatically derived.

Method eq

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

Method ne

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

Implementation of FromStr for Url

Method from_str

fn from_str(s: &str) -> Option<Url>

Implementation of ToStr for Url

Method to_str

fn to_str(&self) -> ~str

Implementation of IterBytes for Url

Method iter_bytes

fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool

Function decode

fn decode(s: &str) -> ~str

Decode a string encoded with percent encoding.

This will only decode escape sequences generated by encode.

Function decode_component

fn decode_component(s: &str) -> ~str

Decode a string encoded with percent encoding.

Function decode_form_urlencoded

fn decode_form_urlencoded(s: &[u8]) -> HashMap<~str, ~[~str]>

Decode a string encoded with the 'application/x-www-form-urlencoded' media type into a hashmap.

Function encode

fn encode(s: &str) -> ~str

Encodes a URI by replacing reserved characters with percent encoded character sequences.

This function is compliant with RFC 3986.

Function encode_component

fn encode_component(s: &str) -> ~str

Encodes a URI component by replacing reserved characters with percent encoded character sequences.

This function is compliant with RFC 3986.

Function encode_form_urlencoded

fn encode_form_urlencoded(m: &HashMap<~str, ~[~str]>) -> ~str

Encode a hashmap to the 'application/x-www-form-urlencoded' media type.

Function from_str

fn from_str(rawurl: &str) -> Result<Url, ~str>

Parse a str to a url

Arguments

rawurl - a string representing a full url, including scheme.

Returns

a url that contains the parsed representation of the url.

Function get_scheme

fn get_scheme(rawurl: &str) -> Result<(~str, ~str), ~str>

Function query_to_str

fn query_to_str(query: &Query) -> ~str

Function to_str

fn to_str(url: &Url) -> ~str

Format a url as a string

Arguments

url - a url.

Returns

a str that contains the formatted url. Note that this will usually be an inverse of from_str but might strip out unneeded separators. for example, "http://somehost.com?", when parsed and formatted, will result in just "http://somehost.com".