pub trait Contactish {
    fn email(&self) -> Option<&String>;
    fn name(&self) -> Option<&String>;
    fn comment(&self) -> Option<&String>;
    fn new<T>(required: T) -> Self
    where
        T: AsRef<str>
; fn set_name<T>(self, name: T) -> Self
    where
        T: AsRef<str>
; fn set_email<T>(self, email: T) -> Self
    where
        T: AsRef<str>
; fn set_comment<T>(self, comment: T) -> Self
    where
        T: AsRef<str>
; }
Expand description

Unified interface for all contact types

Required Methods

Implementors

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.