email-message 0.6.1

Typed outbound email message and address model
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use email_message::{AddressList, MailboxList};

#[test]
fn mailbox_list_try_from_vec_str() {
    let list = MailboxList::try_from(vec!["jdoe@one.test", "mary@x.test"])
        .expect("mailbox list should parse");
    assert_eq!(list.len(), 2);
}

#[test]
fn address_list_try_from_slice_str() {
    let src = ["jdoe@one.test", "Undisclosed recipients:;"];
    let list = AddressList::try_from(src.as_slice()).expect("address list should parse");
    assert_eq!(list.len(), 2);
}