[src]

Function url::get_scheme

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

Returns a tuple of the URI scheme and the rest of the URI, or a parsing error.

Does not include the separating : character.

Example

use url::get_scheme;

let scheme = match get_scheme("https://example.com/") {
    Ok((sch, _)) => sch,
    Err(_) => ~"(None)",
};
println!("Scheme in use: {}.", scheme); // Scheme in use: https.