#url #compile-time #validation #error #macro #detection #check

macro url-macro

A compile-time URL validation macro. Parses and checks URLs at compile-time, converting valid URLs into url::Url objects. Provides early error detection for malformed URLs.

13 releases

new 0.1.12 Feb 16, 2025
0.1.11 Feb 15, 2025
0.1.10 Jan 8, 2025
0.1.9 Sep 4, 2024
0.1.7 Jul 31, 2024

#314 in Procedural macros

Download history 161/week @ 2024-10-27 204/week @ 2024-11-03 154/week @ 2024-11-10 343/week @ 2024-11-17 151/week @ 2024-11-24 493/week @ 2024-12-01 217/week @ 2024-12-08 352/week @ 2024-12-15 112/week @ 2024-12-22 165/week @ 2024-12-29 524/week @ 2025-01-05 630/week @ 2025-01-12 472/week @ 2025-01-19 405/week @ 2025-01-26 269/week @ 2025-02-02 400/week @ 2025-02-09

1,574 downloads per month

Apache-2.0 OR MIT

16KB
210 lines

Compile-time URL validation

Build Documentation

This crate provides a url! macro for compile-time URL validation.

Examples

// This compiles correctly
let valid = url!("https://www.rust-lang.org/");
// This triggers a compiler error
let invalid = url!("foo");

Installation

cargo add url-macro url

Gratitude

Like the project? ⭐ Star this repo on GitHub!

License

Apache License 2.0 or MIT License at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2–3MB
~54K SLoC