#[non_exhaustive]pub enum OpenMeteoError {
Request {
what: &'static str,
value: String,
},
Net(NetError),
Json(String),
Server {
reason: String,
},
Missing {
field: String,
},
Units {
field: String,
found: String,
expected: &'static str,
},
TimeOutside {
time_unix_s: i64,
first_s: i64,
last_s: i64,
},
OutOfRange {
field: String,
value: f64,
},
NoSurface {
field: String,
},
Atmos(AtmosError),
}Expand description
Why an Open-Meteo request or response was refused.
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.
Request
A request field is outside its range.
Net(NetError)
The fetch failed.
Json(String)
The body is not JSON.
Server
The body is Open-Meteo’s error answer, from OpenMeteoProfile::parse. Open-Meteo sends
it with an HTTP error status, which Http reports as NetError::Transport without the
body; fetch reports any answer that doesn’t parse as NetError::Refused, with this
error’s message.
Missing
A field or variable is absent, or not of the expected type.
Units
A variable is in a unit other than the one asked for.
Fields
TimeOutside
The time is outside the response’s hours.
Fields
OutOfRange
A surface value is outside its range at the launch time.
NoSurface
A surface value is missing at the launch time.
Atmos(AtmosError)
A height or level was refused by the atmosphere.
Trait Implementations§
Source§impl Debug for OpenMeteoError
impl Debug for OpenMeteoError
Source§impl Display for OpenMeteoError
impl Display for OpenMeteoError
Source§impl Error for OpenMeteoError
impl Error for OpenMeteoError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<AtmosError> for OpenMeteoError
impl From<AtmosError> for OpenMeteoError
Source§fn from(source: AtmosError) -> Self
fn from(source: AtmosError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for OpenMeteoError
impl !UnwindSafe for OpenMeteoError
impl Freeze for OpenMeteoError
impl Send for OpenMeteoError
impl Sync for OpenMeteoError
impl Unpin for OpenMeteoError
impl UnsafeUnpin for OpenMeteoError
Blanket Implementations§
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
Mutably borrows from an owned value. Read more