#url #validation #utilities #error

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.

15 releases

new 0.2.0 Mar 30, 2025
0.1.13 Feb 22, 2025
0.1.10 Jan 8, 2025
0.1.9 Sep 4, 2024
0.1.7 Jul 31, 2024

#392 in Procedural macros

Download history 228/week @ 2024-12-07 361/week @ 2024-12-14 101/week @ 2024-12-21 168/week @ 2024-12-28 478/week @ 2025-01-04 662/week @ 2025-01-11 493/week @ 2025-01-18 394/week @ 2025-01-25 270/week @ 2025-02-01 371/week @ 2025-02-08 741/week @ 2025-02-15 865/week @ 2025-02-22 503/week @ 2025-03-01 709/week @ 2025-03-08 692/week @ 2025-03-15 729/week @ 2025-03-22

2,855 downloads per month
Used in socio_providers

Apache-2.0 OR MIT

22KB
354 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-2.0 or MIT.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, shall be licensed as above, without any additional terms or conditions.

Dependencies

~2–3MB
~55K SLoC