#welcome #message #io-crates-crumble

crumble

A robust, minimal library for parsing MIME documents

5 unstable releases

new 0.11.1 Mar 27, 2025
0.10.2 Oct 11, 2020
0.10.1 Oct 4, 2020
0.10.0 Sep 28, 2019
0.9.0 Sep 13, 2019

#750 in Cryptography

Download history 9/week @ 2024-11-28 50/week @ 2024-12-05 31/week @ 2024-12-12 2/week @ 2024-12-19 1/week @ 2025-01-02 6/week @ 2025-01-09 5/week @ 2025-02-13

336 downloads per month

GPL-3.0-or-later

1.5MB
852 lines

crumble

A robust, minimal library for parsing mime documents. Supports UTF-8, multipart and nested structures. Will try (usually successfully) to parse noncompliant documents.

Usage

Just add crumble = "0.11.1" to your dependencies. Then, given a String rep of a MIME document, parse with Message::new(&mime).

Documentation: https://docs.rs/crumble/ Crate: https://crates.io/crates/crumble

Notes

  • Only returns a simple "AST". You should wrap this in something e.g. crinkle for it to be useful.
  • Example MIME documents which fail parsing welcome!
  • Mirrored on GitHub, upstream is on sr.ht.

Licence

GPLv3+


lib.rs:

crumble

A robust, minimal library for parsing MIME documents.

Supports UTF-8, multipart documents, and nested documents. crumble assumes input is mostly compliant and tries to parse input as best as possible.

Output is a minimal AST-like structure, with no filtering. This structure should be further processed to produce useful work. See for example crinkle.

Example

use crumble::Message;
let message = load_mime_file(); // Example! The consumer must have some source of documents
let message = Message::new(&message)?; // Handle errors

Dependencies

~3.5–5MB
~83K SLoC