1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*!
Relatively näive [Pest](https://pest.rs/) based parser, picking out "contacts"
from email address lists found in headers such as `from`, `to`, `cc`, etc.

This library aims to be practical rather than "correct". It is (potentially
excessively) permissive to parse even the worst garbage in anyone's inbox.
Limited testing with real world data has been, but the grammar that forms the
basis for this library probably still needs work to catch more edge cases.

# Example

```rust
use email_address_list::*;

let manual: AddressList = vec![
    Contact::new("ríomhphost@example.org").set_name("Túsainm Sloinne"),
    Contact::new("sampla@example.org")
].into();

let result = parse_address_list(
    "Túsainm Sloinne <ríomhphost@example.org>, sampla@example.org"
).unwrap();

assert!(result.deep_eq(&manual));
```
*/
extern crate pest;
#[macro_use]
extern crate pest_derive;

pub mod error;

mod address_list;
pub use address_list::*;

mod parser;
pub use parser::{parse_address_list, parse_contact};

#[cfg(test)]
mod tests;