minted_contact library

Email addresses and phone numbers as well-modelled value types.

Every type is built on "parse, don't validate": no public constructor, so an instance that exists is well-formed. parse reports why it refused, where tryParse just hands back null.

Classes

EmailConstants
The role mailboxes, each at the example.com that RFC 2606 ยง3 reserves.
PhoneNumberConstants
The PhoneNumber values RFC 3966 and RFC 6116 use as their own examples.

Enums

EmailFailure
Why an Email refused its input. One variant is the ceiling, not a shortcut, since email_validator exposes a single bool and a finer diagnosis would be a guess.
PhoneNumberFailure
Why a PhoneNumber refused its input. Only unknownCountryCallingCode comes from the engine, which throws one of its 5 codes in practice, so the rest get checked here.
PhoneNumberType

Extension Types

Email
An email address, checked against the RFC 5322 grammar by email_validator. Standard: RFC 5322.
PhoneNumber
A phone number, stored in canonical E.164 form by phone_numbers_parser. Standard: E.164.