Struct email_pass::Email
source · pub struct Email { /* private fields */ }
Implementations§
source§impl Email
impl Email
sourcepub fn build(username: &str, domain: &str) -> Result<Self, EmailError>
pub fn build(username: &str, domain: &str) -> Result<Self, EmailError>
Creates a new Email
instance.
§Parameters
username
- The username of the email address.domain
- The domain of the email address.
§Returns
Returns a Result
with a EmailError
if the username or domain is not valid.
pub fn username(&self) -> &str
pub fn local(&self) -> &str
pub fn domain(&self) -> &str
sourcepub fn set_username(&mut self, username: &str) -> Result<(), EmailError>
pub fn set_username(&mut self, username: &str) -> Result<(), EmailError>
Sets the username of the email address.
§Parameters
username
- The new username of the email address.
§Returns
Returns a Result
with a EmailError
if the username is not valid.
sourcepub fn set_domain(&mut self, domain: &str) -> Result<(), EmailError>
pub fn set_domain(&mut self, domain: &str) -> Result<(), EmailError>
Sets the domain of the email address.
§Parameters
domain
- The new domain of the email address.
§Returns
Returns a Result
with a EmailError
if the domain is not valid.
Trait Implementations§
source§impl PartialEq for Email
impl PartialEq for Email
impl Eq for Email
impl StructuralPartialEq for Email
Auto Trait Implementations§
impl Freeze for Email
impl RefUnwindSafe for Email
impl Send for Email
impl Sync for Email
impl Unpin for Email
impl UnwindSafe for Email
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more