#[non_exhaustive]pub enum BearerTokenError {
Transport(Error),
Status {
status: u16,
body: String,
},
Malformed(String),
}Expand description
Raised when a BearerTokenProvider cannot produce a bearer token.
The variants cover what a provider that does its own HTTP typically hits.
A provider is free to use whichever fits; Malformed
doubles as the catch-all for a failure that isn’t transport or status
shaped (an expired refresh token, a missing keyring entry, …).
Marked #[non_exhaustive]: new failure modes may be added in future releases
without a breaking change, so downstream matches should carry a wildcard arm.
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.
Transport(Error)
Transport-level failure (connection refused, TLS error, timeout, …).
Status
An upstream credential endpoint returned a non-success HTTP status.
Malformed(String)
The credential could not be parsed, or is otherwise unusable.
Trait Implementations§
Source§impl Debug for BearerTokenError
impl Debug for BearerTokenError
Source§impl Display for BearerTokenError
impl Display for BearerTokenError
Source§impl Error for BearerTokenError
impl Error for BearerTokenError
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 !RefUnwindSafe for BearerTokenError
impl !UnwindSafe for BearerTokenError
impl Freeze for BearerTokenError
impl Send for BearerTokenError
impl Sync for BearerTokenError
impl Unpin for BearerTokenError
impl UnsafeUnpin for BearerTokenError
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