iri-rs 3.3.2

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::IriBuf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut iri = IriBuf::new("https://www.rust-lang.org")?;

    iri.set_authority(Some("www.rust-lang.org:40"))?;
    iri.set_path("/foo/bar")?;
    iri.set_query(Some("query"))?;
    iri.set_fragment(Some("fragment"))?;

    assert_eq!(iri, "https://www.rust-lang.org:40/foo/bar?query#fragment");
    Ok(())
}