#[non_exhaustive]pub enum Error {
Show 16 variants
Io(Error),
RustlsHandshake(HandshakeError<TcpStream>),
TlsHandshake(HandshakeError<TcpStream>),
Tls(Error),
Bad(Bad),
No(No),
Bye(Bye),
ConnectionLost,
Parse(ParseError),
Validate(ValidateError),
Append,
Unexpected(Response<'static>),
MissingStatusResponse,
TagMismatch(TagMismatch),
StartTlsNotAvailable,
TlsNotConfigured,
}
Expand description
A set of errors that can occur in the IMAP client
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
An io::Error
that occurred while trying to read or write to a network stream.
RustlsHandshake(HandshakeError<TcpStream>)
An error from the rustls
library during the TLS handshake.
TlsHandshake(HandshakeError<TcpStream>)
An error from the native_tls
library during the TLS handshake.
Tls(Error)
An error from the native_tls
library while managing the socket.
Bad(Bad)
A BAD response from the IMAP server.
No(No)
A NO response from the IMAP server.
Bye(Bye)
A BYE response from the IMAP server.
ConnectionLost
The connection was terminated unexpectedly.
Parse(ParseError)
Error parsing a server response.
Validate(ValidateError)
Command inputs were not valid IMAP strings.
Append
Error appending an e-mail.
Unexpected(Response<'static>)
An unexpected response was received. This could be a response from a command,
or an unsolicited response that could not be converted into a local type in
UnsolicitedResponse
.
MissingStatusResponse
In response to a STATUS command, the server sent OK without actually sending any STATUS responses first.
TagMismatch(TagMismatch)
The server responded with a different command tag than the one we just sent.
A new session must generally be established to recover from this. You can also use
Connection::skip_tag
(which is available through
both Client
and Session
).
StartTlsNotAvailable
StartTls is not available on the server
TlsNotConfigured
Returns when Tls is not configured