Crate iref_macros

Source
Expand description

This is crate provides useful macros to build 'static URI/IRIs and URI/IRI references at compile time. It is re-exported by the iref crate when the macros feature is enabled.

§Basic usage

Using the iref crate, enable the macros feature and use the uri! (resp. iri!) macro to build URI (resp. IRI) statically, or the uri_ref! (resp iri_ref!) macro to build URI (resp. IRI) references statically.

use iref::{Iri, IriRef, iri, iri_ref};

const IRI: &'static Iri = iri!("https://www.rust-lang.org/foo/bar#frag");
const IRI_REF: &'static IriRef = iri_ref!("/foo/bar#frag");

Macros§

iri
Build an IRI with a 'static lifetime at compile time.
iri_ref
Build an IRI reference with a 'static lifetime at compile time.
uri
Build an URI with a 'static lifetime at compile time.
uri_ref
Build an URI reference with a 'static lifetime at compile time.