[][src]Enum rparif::error::RParifError

pub enum RParifError {
    RequestError(RequestError),
    JsonError(JsonError),
    DateParseError(ParseError),
    UnkownEnumValue(String),
    WrongJsonType {
        expected: String,
        json: String,
    },
    UnexpectedDate(String),
    CallError {
        url: String,
        body: String,
        status: u16,
    },
    MissingJsonKey {
        key: String,
        json: String,
    },
}

Variants

RequestError(RequestError)

Error from reqwest lib

JsonError(JsonError)

Error from json lib

DateParseError(ParseError)

Date error from chrono lib

UnkownEnumValue(String)

String can't be converted into enum value it contains the wrong token

WrongJsonType

Raised when json response contains an unexpected type

Fields of WrongJsonType

expected: String

Expected type (array, object, string, ...etc)

json: String

Actual JSON

UnexpectedDate(String)

Raised when string date can't be converted.
Accepted string are hier, jour and demain

CallError

Raised when the API call return status code other than 2XX

Fields of CallError

url: String

URL that raise the error

body: String

HTTP body of AirParif API error

status: u16

HTTP status code

MissingJsonKey

Raised when key doesn't exists in json response

Fields of MissingJsonKey

key: String

Name of the missing key in JSON

json: String

Actual JSON

Trait Implementations

impl Debug for RParifError[src]

impl Display for RParifError[src]

impl Error for RParifError[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

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.

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.