6 releases

0.3.2 Aug 21, 2025
0.3.1 Nov 22, 2023
0.3.0 Jun 5, 2023
0.2.0 Sep 8, 2022
0.1.0 Feb 2, 2018

#508 in Parser implementations

Download history 428385/week @ 2026-01-21 463048/week @ 2026-01-28 566192/week @ 2026-02-04 575950/week @ 2026-02-11 477663/week @ 2026-02-18 503473/week @ 2026-02-25 584379/week @ 2026-03-04 667502/week @ 2026-03-11 574960/week @ 2026-03-18 605559/week @ 2026-03-25 588607/week @ 2026-04-01 705609/week @ 2026-04-08 683249/week @ 2026-04-15 747809/week @ 2026-04-22 745938/week @ 2026-04-29 770935/week @ 2026-05-06

3,077,958 downloads per month
Used in 1,450 crates (64 directly)

MIT/Apache

31KB
636 lines

data-url

crates.io docs.rs

Processing of data: URLs in Rust according to the Fetch Standard: https://fetch.spec.whatwg.org/#data-urls but starting from a string rather than a parsed URL to avoid extra copies.

use data_url::{DataUrl, mime};

let url = DataUrl::process("data:,Hello%20World!").unwrap();
let (body, fragment) = url.decode_to_vec().unwrap();

assert!(url.mime_type().is("text", "plain"));
assert_eq!(url.mime_type().get_parameter("charset"), Some("US-ASCII"));
assert_eq!(body, b"Hello World!");
assert!(fragment.is_none());

No runtime deps