Crate uri_parser[−][src]
Module to provide a light URI parser focused on easy access to and inspection of URI components
Examples
use uri_parser::parse_uri; let uri_string = "http://usak:kulisak@www.example.com:8080/root/test?kulo=sak&kde=je&help=no&usi=yes#middle"; let parsed_uri = parse_uri(uri_string).unwrap(); assert_eq!(parsed_uri.port, Some(8080)); assert_eq!(parsed_uri.host, Some("www.example.com")); assert!(parsed_uri.user.is_some()); let d = parsed_uri.query.unwrap(); let h=d.get("help").unwrap(); assert_eq!(*h, "no");
Structs
URI |
Represents parsed URI structure URI parts are scheme, user (struct with name and password), host, port path (represented as std::path::Path), query (HashMap of key, value pairs) and hash (fragment) |
User |
Enums
Error |
Possible parsing errors |
Functions
parse_uri |
Parses URI from string or bytes slice Returns Result with URI structure or parsing Error |