#welcome #crumble #gp-lv3

crumble

A robust, minimal library for parsing MIME documents

5 unstable releases

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

#61 in Email

Download history 1/week @ 2024-12-21 3/week @ 2025-01-04 4/week @ 2025-01-11 1/week @ 2025-02-08 4/week @ 2025-02-15 99/week @ 2025-03-22 37/week @ 2025-03-29 8/week @ 2025-04-05

144 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 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

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+

Dependencies

~3.5–5MB
~82K SLoC