email_address_list/lib.rs
1/*!
2Relatively näive [Pest](https://pest.rs/) based parser, picking out "contacts"
3from email address lists found in headers such as `from`, `to`, `cc`, etc.
4
5This library aims to be practical rather than "correct". It is (potentially
6excessively) permissive to parse even the worst garbage in anyone's inbox.
7Limited testing with real world data has been, but the grammar that forms the
8basis for this library probably still needs work to catch more edge cases.
9
10# Example
11
12```rust
13use email_address_list::*;
14
15let manual: AddressList = vec![
16 Contact::new("ríomhphost@example.org").set_name("Túsainm Sloinne"),
17 Contact::new("sampla@example.org")
18].into();
19
20let result = parse_address_list(
21 "Túsainm Sloinne <ríomhphost@example.org>, sampla@example.org"
22).unwrap();
23
24assert!(result.deep_eq(&manual));
25```
26*/
27
28pub mod error;
29
30mod address_list;
31pub use crate::address_list::*;
32
33mod parser;
34pub use crate::parser::{parse_address_list, parse_contact};