email-address-list 0.2.1

Pest based parser for address-lists in email headers like to/from/cc/etc.
Documentation

email-address-list

Build status Crate version Documentation License

Relatively naïve Pest 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 in parsing even the worst garbage in everyone's inbox. Limited testing with real world data was done, but the grammar probably still needs work to catch more edge cases.

Since this library is quite young, the API might change in $version + 0.1 releases, but minor ones won't break compatibility.

Example

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));

For further information, please see the documentation.

Thanks