pub enum Commands {
Show 14 variants
HELO,
EHLO,
MAIL,
RCPT,
DATA,
RSET,
VRFY,
EXPN,
HELP,
NOOP,
QUIT,
AUTH,
STARTTLS,
UNKNOWN(String),
}Expand description
§SMTP Commands
This enum represents the commands that the SMTP server can receive.
Variants§
HELO
HELO Command
This command is used to identify the client to the server.
EHLO
Extended HELO
Usually used for getting the server capabilities.
MAIL Command
This command is used to specify the sender of the email.
RCPT
RCPT Command
This command is used to specify the recipient of the email.
DATA
DATA Command This command is used to send the email data.
RSET
RSET Command
This command is used to reset the session.
VRFY
VRFY Command
This command is used to verify the email address.
EXPN
EXPN Command
This command is used to expand the mailing list.
HELP
HELP Command
This command is used to get help from the server.
NOOP
NOOP Command
This command is used to do nothing.
QUIT
QUIT Command
This command is used to quit the session.
AUTH
AUTH Command
This command is used to authenticate the user.
STARTTLS
STARTTLS Command
This command is used to start the TLS session.
UNKNOWN(String)
Unknown Command
This command is used when the command is not recognized.
Implementations§
Source§impl Commands
impl Commands
Sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
§From Bytes
This function converts a byte array to a Commands enum.
Sourcepub fn parse_mail_command_data(data: String) -> Result<EmailAddress, SMTPError>
pub fn parse_mail_command_data(data: String) -> Result<EmailAddress, SMTPError>
§Parse MAIL Command Data
This function parses the data from the MAIL command.
Sourcepub fn parse_rcpt_command_data(data: String) -> Result<EmailAddress, SMTPError>
pub fn parse_rcpt_command_data(data: String) -> Result<EmailAddress, SMTPError>
§Parse RCPT Command Data
This function parses the data from the RCPT command.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Commands
impl<'de> Deserialize<'de> for Commands
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>,
Source§impl Ord for Commands
impl Ord for Commands
Source§impl PartialOrd for Commands
impl PartialOrd for Commands
impl Eq for Commands
impl StructuralPartialEq for Commands
Auto Trait Implementations§
impl Freeze for Commands
impl RefUnwindSafe for Commands
impl Send for Commands
impl Sync for Commands
impl Unpin for Commands
impl UnwindSafe for Commands
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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>
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>
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