Expand description
This is a URL parsing library.
The goal of this project is to provide simple parsing URL library like urllib.parse in Python3.x.
§Examples
use urlparse::urlparse;
use urlparse::GetQuery; // Trait
let url = urlparse("http://www.example.com/foo?bar=123&col=println%21%28%22TEST%21%22%29&col=sub");
let query = url.get_parsed_query().unwrap();
assert_eq!(url.scheme, "http");
assert_eq!(query.get_first_from_str("col").unwrap(), "println!(\"TEST!\")");
Structs§
Traits§
Functions§
- parse_
qs - Parses a query given as a string argument.
- quote
- Replaces special characters in string using the %xx escape. Letters, digits, and the characters ‘_.-’ are never quoted.
- quote_
plus - Like quote(), but also replaces ’ ’ with ‘+’, as required for quoting HTML form values.
- unquote
- Replaces %xx escapes by their single-character equivalent.
- unquote_
plus - Like unquote(), but also replaces plus signs by spaces, as required for unquoting HTML form values.
- urlparse
- Parses a URL and returns a
Url
object. This is synonymous withUrl::parse()
. - urlunparse
- Returns a URL string from a
Url
object. This is synonymous withunparse()
defined inUrl
.
Type Aliases§
- Query
- An alias type of
HashMap<String, QueryValue>
. - Query
Value - An alias type of
Vec<String>
.