iri-rs 3.3.4

Allocation-conscious URI/IRI (RFC 3986/3987) parser, resolver and normalizer with borrowed and owned types, optional compile-time macros and vocabulary enums.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use iri_rs::{InvalidIri, Iri};

fn main() -> Result<(), InvalidIri<&'static str>> {
    let iri = Iri::parse("https://www.rust-lang.org/foo/bar?query#frag")?;

    println!("scheme: {}", iri.scheme());
    println!("authority: {}", iri.authority().unwrap());
    println!("path: {}", iri.path());
    println!("query: {}", iri.query().unwrap());
    println!("fragment: {}", iri.fragment().unwrap());

    Ok(())
}