#[non_exhaustive]pub enum ApiClientError {
Show 13 variants
Auth(AuthError),
ClientWithEndpoint {
endpoint: String,
source: NetworkError,
},
Client {
source: NetworkError,
},
Http(Error),
Body(BodyError),
DecodeError(DecodeError),
Conversion(ConversionError),
ProtoError(ProtoError),
InvalidUri(InvalidUri),
Expired(Expired),
Other(Box<dyn RetryableError>),
OtherUnretryable(BoxDynError),
WritesDisabled,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Auth(AuthError)
ClientWithEndpoint
The client encountered an error.
Client
The transport failed. Retryability follows the source.
Fields
source: NetworkErrorHttp(Error)
The HTTP request is invalid. Not retryable.
Body(BodyError)
The request body is invalid. Not retryable.
DecodeError(DecodeError)
The response cannot be decoded. Not retryable.
Conversion(ConversionError)
A protocol conversion failed. Not retryable.
ProtoError(ProtoError)
A protocol operation failed. Not retryable.
InvalidUri(InvalidUri)
The URI is invalid. Not retryable.
Expired(Expired)
The request expired. Retryable.
Other(Box<dyn RetryableError>)
A client operation failed. Retryability follows the source.
OtherUnretryable(BoxDynError)
A client operation failed. Not retryable.
WritesDisabled
Writes are disabled. Not retryable.
Implementations§
Source§impl ApiClientError
impl ApiClientError
Sourcepub fn is_locked_out(&self) -> bool
pub fn is_locked_out(&self) -> bool
True while an authentication cool-down runs. #[error(transparent)]
forwards Display but not source(), so the inner AuthError cannot be
reached by walking the chain. Match the variant instead.
Source§impl ApiClientError
impl ApiClientError
pub fn new(endpoint: ApiEndpoint, source: impl RetryableError + 'static) -> Self
Sourcepub fn endpoint(self, endpoint: impl ToString) -> Self
pub fn endpoint(self, endpoint: impl ToString) -> Self
add an endpoint to a ApiError::Client error
pub fn client(client: impl RetryableError + 'static) -> Self
Sourcepub fn network_error(&self) -> Option<&NetworkError>
pub fn network_error(&self) -> Option<&NetworkError>
Try to pull a NetworkError out of this error enum.
returns None if there’s no match
Source§impl ApiClientError
impl ApiClientError
pub fn other<R: RetryableError + 'static>(e: R) -> Self
Trait Implementations§
Source§impl Debug for ApiClientError
impl Debug for ApiClientError
Source§impl Display for ApiClientError
impl Display for ApiClientError
Source§impl Error for ApiClientError
impl Error for ApiClientError
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 ErrorCode for ApiClientError
impl ErrorCode for ApiClientError
Source§fn error_code(&self) -> &'static str
fn error_code(&self) -> &'static str
Source§impl From<AuthError> for ApiClientError
impl From<AuthError> for ApiClientError
Source§impl From<BodyError> for ApiClientError
impl From<BodyError> for ApiClientError
Source§impl From<ConversionError> for ApiClientError
impl From<ConversionError> for ApiClientError
Source§fn from(source: ConversionError) -> Self
fn from(source: ConversionError) -> Self
Source§impl From<DecodeError> for ApiClientError
impl From<DecodeError> for ApiClientError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Source§impl From<Error> for ApiClientError
impl From<Error> for ApiClientError
Source§impl From<Expired> for ApiClientError
impl From<Expired> for ApiClientError
Source§impl From<Infallible> for ApiClientError
impl From<Infallible> for ApiClientError
Source§fn from(_v: Infallible) -> ApiClientError
fn from(_v: Infallible) -> ApiClientError
Source§impl From<InvalidUri> for ApiClientError
impl From<InvalidUri> for ApiClientError
Source§impl From<ProtoError> for ApiClientError
impl From<ProtoError> for ApiClientError
Source§fn from(source: ProtoError) -> Self
fn from(source: ProtoError) -> Self
Source§impl RetryableError for ApiClientError
impl RetryableError for ApiClientError
fn is_retryable(&self) -> bool
Auto Trait Implementations§
impl Freeze for ApiClientError
impl !RefUnwindSafe for ApiClientError
impl Send for ApiClientError
impl Sync for ApiClientError
impl Unpin for ApiClientError
impl UnsafeUnpin for ApiClientError
impl !UnwindSafe for ApiClientError
Blanket Implementations§
§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read more§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read more§fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].