Function openweathermap::update [−][src]
pub fn update(receiver: &Receiver) -> Option<Result<CurrentWeather, String>>
Expand description
Get current weather update that the spawned thread could fetched.
Parameters
receiver
: the channel receiver from preceded call toopenweathermap::init()
Returng value
- ⇒
None
: No update available - ⇒
Some(Result)
: Update available- ⇒
Ok(CurrentWeather)
: Weather information in a nested struct calledCurrentWeather
(see also OpenWeatherMap documentation for details) - ⇒
Err(String)
: Error message about any occured http or json issue- e.g.
401 Unauthorized
: if your API key is invalid - some json parser error message if response from OpenWeatherMap could not be parsed
- e.g.
- ⇒