Skip to main content

ErrorKind

Enum ErrorKind 

Source
#[non_exhaustive]
pub enum ErrorKind { Http(Error), HttpStatus(StatusCode), CredentialsBuild(Error), Credentials(CredentialsError), TonicMetadata(InvalidMetadataValue), GrpcStatus(Error), UrlError(InvalidUri), InvalidApiUrl(String), HeaderValue(InvalidHeaderValue), IdTokenNeedsImpersonation(IdTokenUnsupportedCredentials), InvalidImpersonationUrl(String), CryptoProviderMissing, }
Expand description

Represents the details of the Error

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.
§

Http(Error)

Errors that can possibly occur while accessing an HTTP server.

§

HttpStatus(StatusCode)

An HTTP status other than 2xx.

§

CredentialsBuild(Error)

Credentials could not be built: no Application Default Credentials were found, or a credentials file is malformed or of a type the token cannot be minted from.

§

Credentials(CredentialsError)

Credentials failed to produce a token: a token endpoint refused them or could not be reached. CredentialsError::is_transient says whether a retry may succeed.

§

TonicMetadata(InvalidMetadataValue)

§

GrpcStatus(Error)

§

UrlError(InvalidUri)

§

InvalidApiUrl(String)

An API URL that parses but cannot be connected to: no scheme, a scheme other than http or https, or no host.

§

HeaderValue(InvalidHeaderValue)

A header value built from user input (user agent, headers, the token itself) failed HTTP header validation (e.g. contained a control character).

§

IdTokenNeedsImpersonation(IdTokenUnsupportedCredentials)

The Application Default Credentials hold no service account to mint an ID token as. An ID token needs a service account to impersonate, given to GoogleAuthHeaders::id_token_impersonating.

§

InvalidImpersonationUrl(String)

A service_account_impersonation_url in a credentials file that names no service account.

§

CryptoProviderMissing

The Application Default Credentials sign with a private key of their own, such as a service account key file, and no rustls CryptoProvider is installed to sign with.

Only reported when the auth-default-crypto feature is off. Install a provider with CryptoProvider::install_default before building a client, or enable that feature.

Trait Implementations§

Source§

impl Debug for ErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<ErrorKind> for Error

Source§

fn from(k: ErrorKind) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more