pub struct CurrentWeather {Show 17 fields
pub date: String,
pub temperature: f64,
pub feels_like: f64,
pub humidity: f64,
pub dew_point: f64,
pub pressure: f64,
pub pressure_trend: PressureTrend,
pub condition: WeatherCondition,
pub symbol_name: String,
pub wind: Wind,
pub uv_index: UVIndex,
pub visibility: f64,
pub cloud_cover: f64,
pub cloud_cover_by_altitude: Option<CloudCoverByAltitude>,
pub is_daylight: bool,
pub precipitation_intensity: f64,
pub metadata: WeatherMetadata,
}Fields§
§date: String§temperature: f64§feels_like: f64§humidity: f64§dew_point: f64§pressure: f64§pressure_trend: PressureTrend§condition: WeatherCondition§symbol_name: String§wind: Wind§uv_index: UVIndex§visibility: f64§cloud_cover: f64§cloud_cover_by_altitude: Option<CloudCoverByAltitude>§is_daylight: bool§precipitation_intensity: f64§metadata: WeatherMetadataImplementations§
Source§impl CurrentWeather
impl CurrentWeather
Sourcepub fn pressure_reading(&self) -> Pressure
pub fn pressure_reading(&self) -> Pressure
Examples found in repository?
examples/02_current_weather_snapshot.rs (line 19)
8fn main() -> Result<(), Box<dyn Error>> {
9 let service = WeatherService::shared();
10 let location = support::sample_location();
11
12 if let Some(current) =
13 support::handle_result("current weather", service.current_weather(&location))?
14 {
15 println!(
16 "temp={:.1}°C feels_like={:.1}°C pressure={:.1}hPa daylight={}",
17 current.temperature,
18 current.feels_like,
19 current.pressure_reading().value,
20 current.is_daylight
21 );
22 }
23
24 support::finish("current weather");
25 Ok(())
26}Trait Implementations§
Source§impl Clone for CurrentWeather
impl Clone for CurrentWeather
Source§fn clone(&self) -> CurrentWeather
fn clone(&self) -> CurrentWeather
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CurrentWeather
impl Debug for CurrentWeather
Source§impl<'de> Deserialize<'de> for CurrentWeather
impl<'de> Deserialize<'de> for CurrentWeather
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CurrentWeather
impl PartialEq for CurrentWeather
Source§fn eq(&self, other: &CurrentWeather) -> bool
fn eq(&self, other: &CurrentWeather) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CurrentWeather
Auto Trait Implementations§
impl Freeze for CurrentWeather
impl RefUnwindSafe for CurrentWeather
impl Send for CurrentWeather
impl Sync for CurrentWeather
impl Unpin for CurrentWeather
impl UnsafeUnpin for CurrentWeather
impl UnwindSafe for CurrentWeather
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