iref 4.0.0

Uniform & Internationalized Resource Identifiers (URIs/IRIs), borrowed and owned.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use iref::{Iri, IriError};

fn main() -> Result<(), IriError<&'static str>> {
	let iri = Iri::new("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(())
}