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§
Trait Implementations§
Source§impl Contactish for Contact
Will be handed down on our variants’ contents, which implement the same
trait
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.
Source§fn new<T>(email: T) -> Self
fn new<T>(email: T) -> Self
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) -> Self
fn set_comment<T>(self, comment: T) -> Self
fn set_email<T>(self, email: T) -> Self
fn to_contact(self) -> Self
Source§impl From<EmailContact> for Contact
impl From<EmailContact> for Contact
Source§fn from(contact: EmailContact) -> Contact
fn from(contact: EmailContact) -> Contact
Converts to this type from the input type.
Source§impl From<GarbageContact> for Contact
impl From<GarbageContact> for Contact
Source§fn from(garbage: GarbageContact) -> Contact
fn from(garbage: GarbageContact) -> Contact
Converts to this type from the input type.
Source§impl FromIterator<Contact> for Contacts
impl FromIterator<Contact> for Contacts
Auto Trait Implementations§
impl Freeze for Contact
impl RefUnwindSafe for Contact
impl Send for Contact
impl Sync for Contact
impl Unpin for Contact
impl UnwindSafe for Contact
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