Enum rparif::error::RParifError
source · [−]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,
},
}
Expand description
Errors that can be raised
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
UnexpectedDate(String)
Raised when string date can’t be converted.
Accepted string are hier
, jour
and demain
CallError
Fields
url: String
URL that raise the error
body: String
HTTP body of AirParif API error
status: u16
HTTP status code
Raised when the API call return status code other than 2XX
MissingJsonKey
Raised when key doesn’t exists in json response
Trait Implementations
sourceimpl Debug for RParifError
impl Debug for RParifError
sourceimpl Display for RParifError
impl Display for RParifError
sourceimpl Error for RParifError
impl Error for RParifError
sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
Auto Trait Implementations
impl !RefUnwindSafe for RParifError
impl Send for RParifError
impl Sync for RParifError
impl Unpin for RParifError
impl !UnwindSafe for RParifError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more