| Crates.io | email_address |
| lib.rs | email_address |
| version | 0.2.9 |
| created_at | 2020-03-24 04:02:07.004935+00 |
| updated_at | 2024-07-31 22:44:11.017703+00 |
| description | A Rust crate providing an implementation of an RFC-compliant `EmailAddress` newtype. |
| homepage | |
| repository | https://github.com/johnstonskj/rust-email_address.git |
| max_upload_size | |
| id | 222002 |
| size | 87,010 |
A Rust crate providing an implementation of an RFC-compliant EmailAddress newtype.
Primarily for validation, the EmailAddress type is constructed with
FromStr::from_str which will raise any parsing errors. Prior to constructions
the functions is_valid, is_valid_local_part, and is_valid_domain may also be
used to test for validity without constructing an instance.
Currently, it supports all the RFC ASCII and UTF-8 character set rules as well as quoted and unquoted local parts but does not yet support all the productions required for SMTP headers; folding whitespace, comments, etc.
use email_address::*;
assert!(EmailAddress::is_valid("user.name+tag+sorting@example.com"));
assert_eq!(
EmailAddress::from_str("Abc.example.com"),
Error::MissingSeparator.into()
);
Eq.Option type.Option type documentation.SubDomainEmpty when empty instead of
InvalidCharacter.Thanks to ghandic, blaine-arcjet, Thomasdezeeuw.
PartialEq with case insensitive comparison for
domain part.Hash, because above.new_unchecked to be more flexible.as_str helper method.EmailAddress::new_unchecked function (Sören Meier).Send and Sync implementation, and fixed documentation bug
(Sören Meier).From<EmailAddress> for String.AsRef<str for EmailAddress.local_part and domain accessors.to_uri now supports URI encoding the address as a part of the URI.is_valid_local_part and is_valid_domain methods.domain-literal values, only does surface syntax check.