#[non_exhaustive]pub enum ElevationError {
Request {
what: &'static str,
value: String,
},
Net(NetError),
Json(String),
Server {
reason: String,
},
Missing {
field: String,
},
Count {
expected: usize,
found: usize,
},
OutOfRange {
index: usize,
height_m: f64,
},
}Expand description
Why an elevation request or answer 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.
Fields
Net(NetError)
The fetch failed.
Json(String)
The body is not JSON.
Server
The body is Open-Meteo’s error answer. Open-Meteo sends it with HTTP status 400, which
Http reports as NetError::Transport naming the status, without the body; this error
comes only from a transport that hands the body on, or a self-hosted server that answers
it with status 200.
Missing
A field is absent, or not of the expected type.
Count
The answer holds another number of heights than places asked for.
OutOfRange
A height is outside HEIGHT_RANGE_M.
Trait Implementations§
Source§impl Debug for ElevationError
impl Debug for ElevationError
Source§impl Display for ElevationError
impl Display for ElevationError
Source§impl Error for ElevationError
impl Error for ElevationError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for ElevationError
impl !UnwindSafe for ElevationError
impl Freeze for ElevationError
impl Send for ElevationError
impl Sync for ElevationError
impl Unpin for ElevationError
impl UnsafeUnpin for ElevationError
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