#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.

10 releases

0.1.9 Sep 4, 2024
0.1.8 Aug 5, 2024
0.1.7 Jul 31, 2024

#416 in Procedural macros

Download history 125/week @ 2024-08-18 62/week @ 2024-08-25 177/week @ 2024-09-01 76/week @ 2024-09-08 154/week @ 2024-09-15 141/week @ 2024-09-22 113/week @ 2024-09-29 236/week @ 2024-10-06 324/week @ 2024-10-13 217/week @ 2024-10-20 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 477/week @ 2024-12-01

1,134 downloads per month

Apache-2.0 OR MIT

14KB
224 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

Important: add the url crate too.

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
~55K SLoC