Skip to main content

daaki_message/
lib.rs

1//! RFC 5322 email message parser and builder.
2//!
3//! Provides two main operations:
4//! - [`parse_email`]: Parse raw RFC 5322 message bytes into a structured [`ParsedEmail`]
5//! - [`build_message`]: Construct RFC 5322 message bytes from an [`OutgoingEmail`]
6//!
7//! # References
8//! - RFC 5322 (Internet Message Format)
9//! - RFC 2045 (MIME Part One — body format, Content-Transfer-Encoding)
10//! - RFC 2046 (MIME Part Two — media types, multipart boundaries)
11//! - RFC 2047 (MIME Part Three — encoded words in headers)
12//! - RFC 2183 (Content-Disposition)
13//! - RFC 2231 (MIME parameter encoding)
14//! - RFC 6532 (Internationalized email headers)
15
16pub mod error;
17pub mod types;
18
19mod builder;
20mod parser;
21
22pub use builder::build_message;
23pub use error::Error;
24pub use parser::{parse_email, parse_headers_only};
25pub use types::{
26    Address, BuiltMessage, DateTime, OutgoingAttachment, OutgoingEmail, ParsedAttachment,
27    ParsedEmail,
28};
29
30/// Crate-level `Result` alias using [`Error`].
31pub type Result<T> = std::result::Result<T, Error>;