pub struct EmailAddress { /* private fields */ }Expand description
A parsed email address: local@domain.
§Example
use mailbourne_core::EmailAddress;
let addr = EmailAddress::parse("alice@example.com").unwrap();
assert_eq!(addr.local(), "alice");
assert_eq!(addr.domain(), "example.com");Implementations§
Source§impl EmailAddress
impl EmailAddress
Sourcepub fn parse(s: &str) -> Result<Self, AddressError>
pub fn parse(s: &str) -> Result<Self, AddressError>
Parses local@domain from a string.
This is deliberately strict-and-simple for now: one @, non-empty
halves. Full RFC 5321 address grammar (quoted locals, literals)
arrives with the parser integration.
§Errors
Returns an AddressError describing which structural rule failed.
Trait Implementations§
Source§impl Clone for EmailAddress
impl Clone for EmailAddress
Source§fn clone(&self) -> EmailAddress
fn clone(&self) -> EmailAddress
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmailAddress
impl Debug for EmailAddress
Source§impl Display for EmailAddress
impl Display for EmailAddress
impl Eq for EmailAddress
Source§impl Hash for EmailAddress
impl Hash for EmailAddress
Source§impl PartialEq for EmailAddress
impl PartialEq for EmailAddress
impl StructuralPartialEq for EmailAddress
Auto Trait Implementations§
impl Freeze for EmailAddress
impl RefUnwindSafe for EmailAddress
impl Send for EmailAddress
impl Sync for EmailAddress
impl Unpin for EmailAddress
impl UnsafeUnpin for EmailAddress
impl UnwindSafe for EmailAddress
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more