Enum email_address_list::Contact
source · pub enum Contact {
Email(EmailContact),
Garbage(GarbageContact),
}
Expand description
Either an EmailContact
we could successfully parse or a
GarbageContact
we didn’t want to throw away
Variants
Email(EmailContact)
Garbage(GarbageContact)
Implementations
sourceimpl Contact
impl Contact
pub fn is_garbage(&self) -> bool
Trait Implementations
sourceimpl Contactish for Contact
impl Contactish for Contact
Will be handed down on our variants’ contents, which implement the same trait
The exception to the rule is the ::new
method.
Please note: the current implementation does not (yet?) magically change
a Contact::Garbage
variant into a Contact::Email
one if you try to call
::set_email
. It merely returns an unchanged Self
.
sourcefn new<T>(email: T) -> Selfwhere
T: AsRef<str>,
fn new<T>(email: T) -> Selfwhere
T: AsRef<str>,
By default we create a new Contact::Email
variant, since
Contact::Garbage
is merely a fallback
fn name(&self) -> Option<&String>
fn email(&self) -> Option<&String>
fn comment(&self) -> Option<&String>
fn set_name<T>(self, name: T) -> Selfwhere
T: AsRef<str>,
fn set_comment<T>(self, comment: T) -> Selfwhere
T: AsRef<str>,
fn set_email<T>(self, email: T) -> Selfwhere
T: AsRef<str>,
sourceimpl From<EmailContact> for Contact
impl From<EmailContact> for Contact
sourcefn from(contact: EmailContact) -> Contact
fn from(contact: EmailContact) -> Contact
Converts to this type from the input type.
sourceimpl From<GarbageContact> for Contact
impl From<GarbageContact> for Contact
sourcefn from(garbage: GarbageContact) -> Contact
fn from(garbage: GarbageContact) -> Contact
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for Contact
impl Send for Contact
impl Sync for Contact
impl Unpin for Contact
impl UnwindSafe for Contact
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more