#[non_exhaustive]pub enum AuthNError {
InvalidToken,
Unavailable,
Other(String),
}Expand description
Neutral authentication error returned by a BearerAuthenticator.
Intentionally coarse-grained and transport-agnostic: it never carries the token or any provider-specific detail so it is safe to surface at a trust boundary. Concrete adapters map their own error types into these variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidToken
The token was syntactically present but failed validation (invalid signature, expired, malformed claims, etc.).
The authentication backend could not be reached or returned a transient failure. Callers may choose to retry or surface a 503.
Other(String)
Any other authentication failure. The message must not contain the token or other sensitive material.
Trait Implementations§
Source§impl Debug for AuthNError
impl Debug for AuthNError
Source§impl Display for AuthNError
impl Display for AuthNError
Source§impl Error for AuthNError
impl Error for AuthNError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for AuthNError
impl RefUnwindSafe for AuthNError
impl Send for AuthNError
impl Sync for AuthNError
impl Unpin for AuthNError
impl UnsafeUnpin for AuthNError
impl UnwindSafe for AuthNError
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
Mutably borrows from an owned value. Read more