iri-rs-static
Compile-time macros for building 'static URIs and IRIs for the iri-rs workspace. Fork of static-iref by Timothée Haudebourg.
use Iri;
use iri;
const HOME: = iri!;
Invalid literals fail at compile time:
let _ = iri!;
Each macro validates its input with the real parser from iri-rs-core, then emits a const expression that constructs the type from pre-computed component positions — no runtime parsing, no allocation.
Install
Enable the static feature on the facade crate (recommended):
or depend on this crate directly:
Downstream crates must have iri-rs-core as a direct dependency — the generated code references ::iri_rs_core::*.
Macros
| Macro | Produces |
|---|---|
uri! |
Uri<&'static str> |
uri_ref! |
UriRef<&'static str> |
iri! |
Iri<&'static str> |
iri_ref! |
IriRef<&'static str> |
use ;
use ;
const A: = uri!;
const B: = uri_ref!;
const C: = iri!;
const D: = iri_ref!;
Workspace
Part of the iri-rs workspace. See the root README for the overall picture, motivation, and fork attribution.
MSRV
Rust 1.85 (edition 2024).
License
Dual-licensed: