Types/fns concerning URLs (see RFC 3986)
Query
UserInfo
Input
Url
of Eq for UserInfo
of Eq for Input
of FromStr for Url
of to_str::ToStr for Url
of Eq for Url
of IterBytes for Url
Url
UserInfo
decode
- Decode a string encoded with percent encoding.decode_component
- Decode a string encoded with percent encoding.decode_form_urlencoded
- Decode a string encoded with the 'application/x-www-form-urlencoded' media type into a hashmap.decode_inner
encode
- Encodes a URI by replacing reserved characters with percent encoded character sequences.encode_component
- Encodes a URI component by replacing reserved characters with percent encoded character sequences.encode_form_urlencoded
- Encode a hashmap to the 'application/x-www-form-urlencoded' media type.encode_inner
encode_plus
from_str
- Parse a str
to a url
get_authority
get_path
get_query_fragment
get_scheme
query_from_str
query_to_str
split_char_first
to_str
- Format a url
as a stringuserinfo_from_str
userinfo_to_str
Query
type Query = ~[(~str, ~str)]
UserInfo
type UserInfo = {user: ~str, pass: Option<~str>,}
Input
Digit
Hex
Unreserved
Url
struct Url {
scheme: ~str,
user: Option<UserInfo>,
host: ~str,
port: Option<~str>,
path: ~str,
query: Query,
fragment: Option<~str>,
}
Eq
for UserInfo
eq
fn eq(other: &UserInfo) -> bool
ne
fn ne(other: &UserInfo) -> bool
Eq
for Input
eq
fn eq(other: &Input) -> bool
ne
fn ne(other: &Input) -> bool
FromStr
for Url
from_str
fn from_str(s: &str) -> Option<Url>
to_str::ToStr
for Url
to_str
fn to_str() -> ~str
Eq
for Url
eq
fn eq(other: &Url) -> bool
ne
fn ne(other: &Url) -> bool
IterBytes
for Url
iter_bytes
fn iter_bytes(lsb0: bool, f: to_bytes::Cb)
Url
fn Url(scheme: ~str, user: Option<UserInfo>, host: ~str, port: Option<~str>,
path: ~str, query: Query, fragment: Option<~str>) -> Url
UserInfo
fn UserInfo(user: ~str, pass: Option<~str>) -> UserInfo
decode
fn decode(s: &str) -> ~str
Decode a string encoded with percent encoding.
This will only decode escape sequences generated by encode_uri.
decode_component
fn decode_component(s: &str) -> ~str
Decode a string encoded with percent encoding.
decode_form_urlencoded
fn decode_form_urlencoded(s: ~[u8]) -> map::HashMap<~str, @dvec::DVec<@~str>>
Decode a string encoded with the 'application/x-www-form-urlencoded' media type into a hashmap.
decode_inner
fn decode_inner(s: &str, full_url: bool) -> ~str
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.
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.
encode_form_urlencoded
fn encode_form_urlencoded(m: HashMap<~str, @DVec<@~str>>) -> ~str
Encode a hashmap to the 'application/x-www-form-urlencoded' media type.
encode_inner
fn encode_inner(s: &str, full_url: bool) -> ~str
encode_plus
fn encode_plus(s: &str) -> ~str
from_str
fn from_str(rawurl: &str) -> result::Result<Url, ~str>
Parse a str
to a url
rawurl
- a string representing a full url, including scheme.
a url
that contains the parsed representation of the url.
get_authority
fn get_authority(rawurl: &str) ->
result::Result<(Option<UserInfo>, ~str, Option<~str>, ~str), @~str>
get_path
fn get_path(rawurl: &str, authority: bool) ->
result::Result<(~str, ~str), @~str>
get_query_fragment
fn get_query_fragment(rawurl: &str) ->
result::Result<(Query, Option<~str>), @~str>
get_scheme
fn get_scheme(rawurl: &str) -> result::Result<(~str, ~str), @~str>
query_from_str
fn query_from_str(rawquery: &str) -> Query
query_to_str
fn query_to_str(query: Query) -> ~str
split_char_first
fn split_char_first(s: &str, c: char) -> (~str, ~str)
to_str
fn to_str(url: Url) -> ~str
Format a url
as a string
url
- a url.
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".
userinfo_from_str
fn userinfo_from_str(uinfo: &str) -> UserInfo
userinfo_to_str
fn userinfo_to_str(userinfo: UserInfo) -> ~str