#[non_exhaustive]pub enum Unauthorized {
Retry,
Surface,
Fail(TransportError),
}Expand description
What to do about a rejected credential.
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.
Retry
Send it again. HttpAuth::authorize runs first, so a hook that mints
per request gets a fresh credential without holding one itself.
Surface
Hand the 401 back to the caller as the answer it is.
Fail(TransportError)
Fail the call with this error instead of the response.
For a consumer whose own error type says something the status cannot — “the refresh token is spent, run the login command” is a different fact from “401”, and the one a user can act on.
Trait Implementations§
Auto Trait Implementations§
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