#[non_exhaustive]pub enum AuthFailure {
NoCredentialProvider,
CredentialsUnavailable {
detail: String,
helpers: Vec<String>,
},
UnusableCredentials,
UrlNotDescribable,
UnsupportedScheme {
schemes: Vec<String>,
},
Rejected,
}Expand description
Why an HTTP remote refused access (Error::Auth).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoCredentialProvider
The server asked for credentials (401) and no credential provider is wired.
The credential provider could not supply credentials (no helper has them, and prompting is not possible).
UnusableCredentials
The provider answered without a usable username and password.
UrlNotDescribable
The URL could not be split into the credential fields helpers expect.
UnsupportedScheme
The server only offers authentication schemes grit does not speak (no Basic).
Rejected
Credentials were sent and the server rejected them (401 again).
Implementations§
Source§impl AuthFailure
impl AuthFailure
Sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Whether credentials were sent and refused, as opposed to never being available.
Sourcepub fn from_fill_error(err: Error) -> Self
pub fn from_fill_error(err: Error) -> Self
The failure an HTTP client reports when a credential provider’s
fill fails with err.
Always AuthFailure::CredentialsUnavailable: detail is err’s message,
and helpers is the list an Error::CredentialsUnavailable carries (empty
for any other error). Custom HttpClient
implementations use it to report fill failures the way the built-in client does.
Trait Implementations§
Source§impl Clone for AuthFailure
impl Clone for AuthFailure
Source§impl Debug for AuthFailure
impl Debug for AuthFailure
Source§impl Display for AuthFailure
impl Display for AuthFailure
impl Eq for AuthFailure
Source§impl Error for AuthFailure
impl Error for AuthFailure
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()
Source§impl PartialEq for AuthFailure
impl PartialEq for AuthFailure
impl StructuralPartialEq for AuthFailure
Auto Trait Implementations§
impl Freeze for AuthFailure
impl RefUnwindSafe for AuthFailure
impl Send for AuthFailure
impl Sync for AuthFailure
impl Unpin for AuthFailure
impl UnsafeUnpin for AuthFailure
impl UnwindSafe for AuthFailure
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.