Enum gitlab::api::ApiError[][src]

#[non_exhaustive]
pub enum ApiError<E> where
    E: Error + Send + Sync + 'static, 
{ Client { source: E, }, UrlParse { source: ParseError, }, Body { source: BodyError, }, Json { source: Error, }, Gitlab { msg: String, }, GitlabObject { obj: Value, }, GitlabUnrecognized { obj: Value, }, DataType { source: Error, typename: &'static str, }, Pagination { source: PaginationError, }, }
Expand description

Errors which may occur when using API endpoints.

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

The client encountered an error.

Show fields

Fields of Client

source: E

The client error.

UrlParse

The URL failed to parse.

Show fields

Fields of UrlParse

source: ParseError

The source of the error.

Body

Body data could not be created.

Show fields

Fields of Body

source: BodyError

The source of the error.

Json

JSON deserialization from GitLab failed.

Show fields

Fields of Json

source: Error

The source of the error.

Gitlab

GitLab returned an error message.

Show fields

Fields of Gitlab

msg: String

The error message from GitLab.

GitlabObject

GitLab returned an error object.

Show fields

Fields of GitlabObject

obj: Value

The error object from GitLab.

GitlabUnrecognized

GitLab returned an HTTP error with JSON we did not recognize.

Show fields

Fields of GitlabUnrecognized

obj: Value

The full object from GitLab.

DataType

Failed to parse an expected data type from JSON.

Show fields

Fields of DataType

source: Error

The source of the error.

typename: &'static str

The name of the type that could not be deserialized.

Pagination

An error with pagination occurred.

Show fields

Fields of Pagination

source: PaginationError

The source of the error.

Implementations

impl<E> ApiError<E> where
    E: Error + Send + Sync + 'static, 
[src]

pub fn client(source: E) -> Self[src]

Create an API error in a client error.

Trait Implementations

impl<E: Debug> Debug for ApiError<E> where
    E: Error + Send + Sync + 'static, 
[src]

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

Formats the value using the given formatter. Read more

impl<E> Display for ApiError<E> where
    E: Error + Send + Sync + 'static, 
[src]

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<E> Error for ApiError<E> where
    E: Error + Send + Sync + 'static, 
[src]

fn source(&self) -> Option<&(dyn Error + 'static)>[src]

The lower-level source of this error, if any. Read more

fn backtrace(&self) -> Option<&Backtrace>[src]

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

fn description(&self) -> &str1.0.0[src]

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

fn cause(&self) -> Option<&dyn Error>1.0.0[src]

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

impl From<ApiError<RestError>> for GitlabError[src]

fn from(source: ApiError<RestError>) -> Self[src]

Performs the conversion.

impl<E> From<BodyError> for ApiError<E> where
    E: Error + Send + Sync + 'static, 
[src]

fn from(source: BodyError) -> Self[src]

Performs the conversion.

impl<E> From<Error> for ApiError<E> where
    E: Error + Send + Sync + 'static, 
[src]

fn from(source: Error) -> Self[src]

Performs the conversion.

impl<E> From<PaginationError> for ApiError<E> where
    E: Error + Send + Sync + 'static, 
[src]

fn from(source: PaginationError) -> Self[src]

Performs the conversion.

impl<E> From<ParseError> for ApiError<E> where
    E: Error + Send + Sync + 'static, 
[src]

fn from(source: ParseError) -> Self[src]

Performs the conversion.

Auto Trait Implementations

impl<E> !RefUnwindSafe for ApiError<E>

impl<E> Send for ApiError<E>

impl<E> Sync for ApiError<E>

impl<E> Unpin for ApiError<E> where
    E: Unpin

impl<E> !UnwindSafe for ApiError<E>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

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

fn in_current_span(self) -> Instrumented<Self>[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.