#[non_exhaustive]pub enum Error {
Show 16 variants
Io(Arc<Error>),
Auth {
text: String,
code: Option<ResponseCode>,
},
No {
text: String,
code: Option<ResponseCode>,
},
Bad {
text: String,
code: Option<ResponseCode>,
},
Bye {
text: String,
code: Option<ResponseCode>,
},
Protocol(String),
Parse(String),
Timeout,
Closed,
StartTlsUnavailable,
MissingCapability(String),
AppendLimit {
size: u64,
limit: u64,
},
InvalidAppendDate(String),
Internal(String),
DriverPanicked(String),
DriverGone,
}Expand description
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Arc<Error>)
Underlying I/O error, including TLS transport errors (RFC 3501 Section 2.1).
Wrapped in Arc so that Error can implement Clone.
Auth
Authentication was rejected by the server (RFC 3501 Section 6.2.2).
The optional ResponseCode carries the structured reason code
(e.g., [AUTHENTICATIONFAILED], [EXPIRED], [PRIVACYREQUIRED])
when the server provides one (RFC 5530 Section 3).
Fields
code: Option<ResponseCode>Structured response code, if present (RFC 5530 Section 3).
No
Server returned a NO response to a command (RFC 3501 Section 7.1.2).
The optional ResponseCode carries the structured reason code
(e.g., [NOPERM], [OVERQUOTA]) when the server provides one
(RFC 5530 Section 3).
Fields
code: Option<ResponseCode>Structured response code, if present (RFC 5530 Section 3).
Bad
Server returned a BAD response — client sent something invalid (RFC 3501 Section 7.1.3).
The optional ResponseCode carries the structured reason code
when the server provides one (RFC 5530 Section 3).
Fields
code: Option<ResponseCode>Structured response code, if present (RFC 5530 Section 3).
Bye
Server sent BYE — closing connection (RFC 3501 Section 7.1.5).
BYE responses can include response codes such as [ALERT] or
[UNAVAILABLE] that carry actionable information for the client
(RFC 3501 Section 7.1.5, RFC 5530 Section 3).
The [ALERT] code in particular MUST be presented to the user
(RFC 3501 Section 7.1).
Fields
code: Option<ResponseCode>Structured response code, if present (RFC 5530 Section 3).
Protocol(String)
IMAP protocol violation by the server (RFC 3501 Section 7 / RFC 9051 Section 7).
Parse(String)
Failed to parse a server response (RFC 3501 Section 7 / RFC 9051 Section 7).
Timeout
Operation exceeded the caller-supplied timeout.
This is a client-imposed constraint, not a protocol-level error. See RFC 3501 Section 5.4 for the server-side autologout timer; client-side timeouts guard against indefinite blocking on I/O.
Closed
The TCP connection has been closed (RFC 3501 Section 2.1).
STARTTLS was requested but the server does not advertise it (RFC 3501 Section 6.2.1, RFC 9051 Section 6.2.1).
MissingCapability(String)
A capability required for the requested operation is not advertised (RFC 3501 Section 6.1.1).
AppendLimit
Message exceeds the server’s advertised APPENDLIMIT (RFC 7889 Section 3).
Fields
InvalidAppendDate(String)
The date-time string supplied to APPEND does not conform to the
date-time production in RFC 3501 Section 9.
date-time = DQUOTE date-day-fixed "-" date-month "-" date-year
SP time SP zone DQUOTE
date-day-fixed = (SP DIGIT) / 2DIGIT
date-month = "Jan" / "Feb" / ... / "Dec"
time = 2DIGIT ":" 2DIGIT ":" 2DIGIT
zone = ("+" / "-") 4DIGITInternal(String)
Internal driver error — the driver task stub has not been replaced by its full implementation yet, or an invariant was violated that indicates a bug in the library.
DriverPanicked(String)
The driver task panicked. The payload is the panic message
extracted from the JoinError (best-effort — non-string panics
produce a generic description).
DriverGone
The driver task exited (cleanly or via cancellation) and the command channel is closed, but no panic was observed.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ValidationError> for Error
impl From<ValidationError> for Error
Source§fn from(e: ValidationError) -> Self
fn from(e: ValidationError) -> Self
Source§impl PartialEq for Error
Compares two IMAP errors for equality.
impl PartialEq for Error
Compares two IMAP errors for equality.
The Io variant compares by std::io::ErrorKind only, since
std::io::Error does not implement PartialEq. Two Io errors with the
same ErrorKind are considered equal even if their messages differ.