#[non_exhaustive]pub enum SessionState {
Greeting,
Ehlo,
Authentication,
StartTls,
MailFrom,
RcptTo,
Data,
Quit,
Closed,
}Expand description
The phases of an SMTP exchange tracked by the client.
This enum is non_exhaustive so that future SMTP extensions can add
new phases without forcing a major version bump.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Greeting
Connection has been established but the server greeting has not yet been read.
Ehlo
The greeting has been received but EHLO has not yet been sent (or
has not yet succeeded).
Authentication
EHLO has succeeded. Authentication may be performed, or skipped.
StartTls
STARTTLS has been issued and accepted (220 from server). The
transport is being upgraded; on success the state moves to Ehlo
to re-issue the greeting per RFC 3207 §4.2.
MailFrom
Ready to issue MAIL FROM for a new transaction.
RcptTo
MAIL FROM has been accepted; ready to issue RCPT TO.
Data
At least one RCPT TO has been accepted; ready to issue DATA.
Quit
QUIT has been sent; the next operation is to close the transport.
Closed
The session is finished, either cleanly or due to a fatal error. No further SMTP operations are permitted.
Implementations§
Source§impl SessionState
impl SessionState
Sourcepub const fn is_terminal(self) -> bool
pub const fn is_terminal(self) -> bool
Return true if the session is over and no further SMTP operations
are permitted.
Sourcepub const fn can_transition_to(self, next: Self) -> bool
pub const fn can_transition_to(self, next: Self) -> bool
Return true if next is a valid follow-on state from self.
This encodes the protocol’s ordering rules. The
crate::client::SmtpClient consults this before performing any
operation and returns an crate::error::InvalidInputError if the
transition is not allowed.
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§fn clone(&self) -> SessionState
fn clone(&self) -> SessionState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionState
impl Debug for SessionState
Source§impl Hash for SessionState
impl Hash for SessionState
Source§impl PartialEq for SessionState
impl PartialEq for SessionState
Source§fn eq(&self, other: &SessionState) -> bool
fn eq(&self, other: &SessionState) -> bool
self and other values to be equal, and is used by ==.