Expand description
§use-email-address
Email address and mailbox primitives for RustUse.
§Experimental
use-email-address is experimental while use-email remains below 0.3.0.
§Example
use use_email_address::{AddressValidationMode, EmailAddress, Mailbox};
let address = EmailAddress::new_with_mode("jane@example.com", AddressValidationMode::Practical)?;
let mailbox = Mailbox::new(Some("Jane Doe"), address.to_string())?;
assert_eq!(address.local_part().as_str(), "jane");
assert_eq!(address.domain_part().as_str(), "example.com");
assert_eq!(mailbox.to_string(), "\"Jane Doe\" <jane@example.com>");§Scope
- Address, local-part, domain, display-name, mailbox, mailbox-list, and address-group wrappers.
- Practical, strict ASCII, and internationalized validation modes.
- Conservative formatting and parsing helpers.
§Non-goals
- Complete RFC 5322 or RFC 6532 parsing.
- DNS lookup or deliverability checks.
- Provider-specific address policy.
§License
Licensed under either Apache-2.0 or MIT.
Structs§
- Address
Group - A named group of visible mailboxes.
- Display
Name - Human-readable display name for a mailbox.
- Domain
Part - Email domain-part text.
- Email
Address - Validated email address text split into local and domain parts.
- Local
Part - Email local-part text.
- Mailbox
- A visible mailbox: optional display name plus email address.
- Mailbox
List - A comma-rendered list of visible mailboxes.
Enums§
- Address
Validation Error - Error returned when an email address primitive fails validation.
- Address
Validation Mode - Validation profile for address-like primitives.