#[non_exhaustive]pub enum AuthError {
Rejected {
code: u16,
enhanced: Option<EnhancedStatus>,
message: String,
},
UnsupportedMechanism,
MalformedChallenge(String),
Other(&'static str),
}Expand description
An authentication-specific failure.
This enum is non_exhaustive so that future SASL mechanisms can
add new failure modes without forcing a major version bump.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rejected
The server rejected the credentials. The reply code (typically 535) and server message are preserved; client credentials are not.
Fields
enhanced: Option<EnhancedStatus>Optional enhanced status code (RFC 3463), present only when
the session has ENHANCEDSTATUSCODES enabled. For AUTH
failures, common enhanced codes include 5.7.8
(authentication credentials invalid) and 5.7.9
(authentication mechanism too weak).
UnsupportedMechanism
The server’s EHLO response did not advertise an AUTH mechanism that
this client supports, or did not advertise the specific mechanism
the caller asked for.
MalformedChallenge(String)
The server returned a 334 prompt that did not look like a valid base64 challenge.
Other(&'static str)
A mechanism-specific protocol failure that does not fit the
other variants. Currently used by SCRAM-SHA-256 to surface
malformed server-first / server-final messages, salt or
signature decode failures, server-signature mismatch, and
out-of-policy iteration counts. The &'static str is a
debug aid; callers should not pattern-match on its content
(it is not part of the API contract).
Trait Implementations§
Source§impl Error for AuthError
impl Error for AuthError
1.30.0 · 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()