pub struct EmailAddress {
pub email: String,
pub name: Option<String>,
}
Expand description
Represents an email address containing the email address and name of the sender or recipient.
Fields§
§email: String
The email address of the sender or recipient.
name: Option<String>
The name of the sender or recipient.
Implementations§
Source§impl EmailAddress
impl EmailAddress
Sourcepub fn new<T>(email: T) -> EmailAddress
pub fn new<T>(email: T) -> EmailAddress
Creates a new email address.
§Examples
let address = EmailAddress::new("foo@example.com");
assert_eq!(address.email, "foo@example.com");
assert_eq!(address.name, None);
Sourcepub fn new_with_name<T, U>(email: T, name: U) -> EmailAddress
pub fn new_with_name<T, U>(email: T, name: U) -> EmailAddress
Creates a new email address with the given name.
§Examples
let address = EmailAddress::new_with_name("foo@example.com", "Peter");
assert_eq!(address.email, "foo@example.com");
assert_eq!(address.name, Some("Peter".to_string()));
Trait Implementations§
Source§impl Clone for EmailAddress
impl Clone for EmailAddress
Source§fn clone(&self) -> EmailAddress
fn clone(&self) -> EmailAddress
Returns a copy of the value. Read more
1.0.0 · 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 Default for EmailAddress
impl Default for EmailAddress
Source§fn default() -> EmailAddress
fn default() -> EmailAddress
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EmailAddress
impl<'de> Deserialize<'de> for EmailAddress
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> From<T> for EmailAddress
impl<T> From<T> 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request