pub struct WeatherService { /* private fields */ }Expand description
Wraps a WeatherKit service handle.
Implementations§
Source§impl WeatherService
impl WeatherService
Returns a WeatherKit service that reuses the shared native service.
Sourcepub fn attribution(&self) -> Result<WeatherAttribution, WeatherKitError>
pub fn attribution(&self) -> Result<WeatherAttribution, WeatherKitError>
Fetches WeatherKit attribution information.
Sourcepub fn weather(&self, location: &CLLocation) -> Result<Weather, WeatherKitError>
pub fn weather(&self, location: &CLLocation) -> Result<Weather, WeatherKitError>
Fetches the aggregate WeatherKit weather payload.
Sourcepub fn current_weather(
&self,
location: &CLLocation,
) -> Result<CurrentWeather, WeatherKitError>
pub fn current_weather( &self, location: &CLLocation, ) -> Result<CurrentWeather, WeatherKitError>
Fetches the WeatherKit current weather payload.
Sourcepub fn hourly_forecast(
&self,
location: &CLLocation,
) -> Result<HourlyForecast, WeatherKitError>
pub fn hourly_forecast( &self, location: &CLLocation, ) -> Result<HourlyForecast, WeatherKitError>
Fetches the WeatherKit hourly forecast.
Sourcepub fn hourly_forecast_in(
&self,
location: &CLLocation,
interval: DateInterval,
) -> Result<HourlyForecast, WeatherKitError>
pub fn hourly_forecast_in( &self, location: &CLLocation, interval: DateInterval, ) -> Result<HourlyForecast, WeatherKitError>
Fetches the WeatherKit hourly forecast for the given interval.
Sourcepub fn daily_forecast(
&self,
location: &CLLocation,
) -> Result<DailyForecast, WeatherKitError>
pub fn daily_forecast( &self, location: &CLLocation, ) -> Result<DailyForecast, WeatherKitError>
Fetches the WeatherKit daily forecast.
Sourcepub fn daily_forecast_in(
&self,
location: &CLLocation,
interval: DateInterval,
) -> Result<DailyForecast, WeatherKitError>
pub fn daily_forecast_in( &self, location: &CLLocation, interval: DateInterval, ) -> Result<DailyForecast, WeatherKitError>
Fetches the WeatherKit daily forecast for the given interval.
Sourcepub fn minute_forecast(
&self,
location: &CLLocation,
) -> Result<Option<MinuteForecastCollection>, WeatherKitError>
pub fn minute_forecast( &self, location: &CLLocation, ) -> Result<Option<MinuteForecastCollection>, WeatherKitError>
Fetches the optional WeatherKit minute forecast.
Sourcepub fn weather_alerts(
&self,
location: &CLLocation,
) -> Result<Vec<WeatherAlert>, WeatherKitError>
pub fn weather_alerts( &self, location: &CLLocation, ) -> Result<Vec<WeatherAlert>, WeatherKitError>
Fetches WeatherKit weather alerts.
Sourcepub fn availability(
&self,
location: &CLLocation,
) -> Result<WeatherAvailability, WeatherKitError>
pub fn availability( &self, location: &CLLocation, ) -> Result<WeatherAvailability, WeatherKitError>
Fetches WeatherKit data availability for the location.
Sourcepub fn weather_including(
&self,
location: &CLLocation,
query: WeatherQuery,
) -> Result<WeatherQueryResult, WeatherKitError>
pub fn weather_including( &self, location: &CLLocation, query: WeatherQuery, ) -> Result<WeatherQueryResult, WeatherKitError>
Fetches one WeatherKit query result.
Sourcepub fn weather_including2(
&self,
location: &CLLocation,
query1: WeatherQuery,
query2: WeatherQuery,
) -> Result<(WeatherQueryResult, WeatherQueryResult), WeatherKitError>
pub fn weather_including2( &self, location: &CLLocation, query1: WeatherQuery, query2: WeatherQuery, ) -> Result<(WeatherQueryResult, WeatherQueryResult), WeatherKitError>
Fetches 2 WeatherKit query results in order.
Sourcepub fn weather_including3(
&self,
location: &CLLocation,
query1: WeatherQuery,
query2: WeatherQuery,
query3: WeatherQuery,
) -> Result<(WeatherQueryResult, WeatherQueryResult, WeatherQueryResult), WeatherKitError>
pub fn weather_including3( &self, location: &CLLocation, query1: WeatherQuery, query2: WeatherQuery, query3: WeatherQuery, ) -> Result<(WeatherQueryResult, WeatherQueryResult, WeatherQueryResult), WeatherKitError>
Fetches 3 WeatherKit query results in order.
Sourcepub fn weather_including4(
&self,
location: &CLLocation,
query1: WeatherQuery,
query2: WeatherQuery,
query3: WeatherQuery,
query4: WeatherQuery,
) -> Result<(WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult), WeatherKitError>
pub fn weather_including4( &self, location: &CLLocation, query1: WeatherQuery, query2: WeatherQuery, query3: WeatherQuery, query4: WeatherQuery, ) -> Result<(WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult), WeatherKitError>
Fetches 4 WeatherKit query results in order.
Sourcepub fn weather_including5(
&self,
location: &CLLocation,
query1: WeatherQuery,
query2: WeatherQuery,
query3: WeatherQuery,
query4: WeatherQuery,
query5: WeatherQuery,
) -> Result<(WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult), WeatherKitError>
pub fn weather_including5( &self, location: &CLLocation, query1: WeatherQuery, query2: WeatherQuery, query3: WeatherQuery, query4: WeatherQuery, query5: WeatherQuery, ) -> Result<(WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult), WeatherKitError>
Fetches 5 WeatherKit query results in order.
Sourcepub fn weather_including6(
&self,
location: &CLLocation,
query1: WeatherQuery,
query2: WeatherQuery,
query3: WeatherQuery,
query4: WeatherQuery,
query5: WeatherQuery,
query6: WeatherQuery,
) -> Result<(WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult), WeatherKitError>
pub fn weather_including6( &self, location: &CLLocation, query1: WeatherQuery, query2: WeatherQuery, query3: WeatherQuery, query4: WeatherQuery, query5: WeatherQuery, query6: WeatherQuery, ) -> Result<(WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult, WeatherQueryResult), WeatherKitError>
Fetches 6 WeatherKit query results in order.
Sourcepub fn weather_including_many<I>(
&self,
location: &CLLocation,
queries: I,
) -> Result<Vec<WeatherQueryResult>, WeatherKitError>where
I: IntoIterator<Item = WeatherQuery>,
pub fn weather_including_many<I>(
&self,
location: &CLLocation,
queries: I,
) -> Result<Vec<WeatherQueryResult>, WeatherKitError>where
I: IntoIterator<Item = WeatherQuery>,
Fetches an arbitrary list of WeatherKit query results in order.
Sourcepub fn weather_changes(
&self,
location: &CLLocation,
) -> Result<Option<WeatherChanges>, WeatherKitError>
pub fn weather_changes( &self, location: &CLLocation, ) -> Result<Option<WeatherChanges>, WeatherKitError>
Fetches the optional WeatherKit weather changes payload.
Sourcepub fn historical_comparisons(
&self,
location: &CLLocation,
) -> Result<Option<HistoricalComparisons>, WeatherKitError>
pub fn historical_comparisons( &self, location: &CLLocation, ) -> Result<Option<HistoricalComparisons>, WeatherKitError>
Fetches the optional WeatherKit historical comparisons payload.
Sourcepub fn daily_statistics(
&self,
location: &CLLocation,
query: DailyWeatherStatisticsQuery,
) -> Result<DailyWeatherStatisticsResult, WeatherKitError>
pub fn daily_statistics( &self, location: &CLLocation, query: DailyWeatherStatisticsQuery, ) -> Result<DailyWeatherStatisticsResult, WeatherKitError>
Fetches WeatherKit daily statistics for the requested query.
Sourcepub fn daily_statistics_in(
&self,
location: &CLLocation,
interval: DateInterval,
query: DailyWeatherStatisticsQuery,
) -> Result<DailyWeatherStatisticsResult, WeatherKitError>
pub fn daily_statistics_in( &self, location: &CLLocation, interval: DateInterval, query: DailyWeatherStatisticsQuery, ) -> Result<DailyWeatherStatisticsResult, WeatherKitError>
Fetches WeatherKit daily statistics for the given interval.
Sourcepub fn daily_statistics_between_days(
&self,
location: &CLLocation,
start_day: i64,
end_day: i64,
query: DailyWeatherStatisticsQuery,
) -> Result<DailyWeatherStatisticsResult, WeatherKitError>
pub fn daily_statistics_between_days( &self, location: &CLLocation, start_day: i64, end_day: i64, query: DailyWeatherStatisticsQuery, ) -> Result<DailyWeatherStatisticsResult, WeatherKitError>
Fetches WeatherKit daily statistics for the given day range.
Sourcepub fn daily_summary(
&self,
location: &CLLocation,
query: DailyWeatherSummaryQuery,
) -> Result<DailyWeatherSummaryResult, WeatherKitError>
pub fn daily_summary( &self, location: &CLLocation, query: DailyWeatherSummaryQuery, ) -> Result<DailyWeatherSummaryResult, WeatherKitError>
Fetches the WeatherKit daily summary for the requested query.
Sourcepub fn daily_summary_in(
&self,
location: &CLLocation,
interval: DateInterval,
query: DailyWeatherSummaryQuery,
) -> Result<DailyWeatherSummaryResult, WeatherKitError>
pub fn daily_summary_in( &self, location: &CLLocation, interval: DateInterval, query: DailyWeatherSummaryQuery, ) -> Result<DailyWeatherSummaryResult, WeatherKitError>
Fetches the WeatherKit daily summary for the given interval.
Sourcepub fn hourly_statistics(
&self,
location: &CLLocation,
query: HourlyWeatherStatisticsQuery,
) -> Result<HourlyWeatherStatistics<HourTemperatureStatistics>, WeatherKitError>
pub fn hourly_statistics( &self, location: &CLLocation, query: HourlyWeatherStatisticsQuery, ) -> Result<HourlyWeatherStatistics<HourTemperatureStatistics>, WeatherKitError>
Fetches WeatherKit hourly statistics for the requested query.
Sourcepub fn hourly_statistics_in(
&self,
location: &CLLocation,
interval: DateInterval,
query: HourlyWeatherStatisticsQuery,
) -> Result<HourlyWeatherStatistics<HourTemperatureStatistics>, WeatherKitError>
pub fn hourly_statistics_in( &self, location: &CLLocation, interval: DateInterval, query: HourlyWeatherStatisticsQuery, ) -> Result<HourlyWeatherStatistics<HourTemperatureStatistics>, WeatherKitError>
Fetches WeatherKit hourly statistics for the given interval.
Sourcepub fn hourly_statistics_between_hours(
&self,
location: &CLLocation,
start_hour: i64,
end_hour: i64,
query: HourlyWeatherStatisticsQuery,
) -> Result<HourlyWeatherStatistics<HourTemperatureStatistics>, WeatherKitError>
pub fn hourly_statistics_between_hours( &self, location: &CLLocation, start_hour: i64, end_hour: i64, query: HourlyWeatherStatisticsQuery, ) -> Result<HourlyWeatherStatistics<HourTemperatureStatistics>, WeatherKitError>
Fetches WeatherKit hourly statistics for the given hour range.
Sourcepub fn monthly_statistics(
&self,
location: &CLLocation,
query: MonthlyWeatherStatisticsQuery,
) -> Result<MonthlyWeatherStatisticsResult, WeatherKitError>
pub fn monthly_statistics( &self, location: &CLLocation, query: MonthlyWeatherStatisticsQuery, ) -> Result<MonthlyWeatherStatisticsResult, WeatherKitError>
Fetches WeatherKit monthly statistics for the requested query.
Sourcepub fn monthly_statistics_in(
&self,
location: &CLLocation,
interval: DateInterval,
query: MonthlyWeatherStatisticsQuery,
) -> Result<MonthlyWeatherStatisticsResult, WeatherKitError>
pub fn monthly_statistics_in( &self, location: &CLLocation, interval: DateInterval, query: MonthlyWeatherStatisticsQuery, ) -> Result<MonthlyWeatherStatisticsResult, WeatherKitError>
Fetches WeatherKit monthly statistics for the given interval.
Sourcepub fn monthly_statistics_between_months(
&self,
location: &CLLocation,
start_month: i64,
end_month: i64,
query: MonthlyWeatherStatisticsQuery,
) -> Result<MonthlyWeatherStatisticsResult, WeatherKitError>
pub fn monthly_statistics_between_months( &self, location: &CLLocation, start_month: i64, end_month: i64, query: MonthlyWeatherStatisticsQuery, ) -> Result<MonthlyWeatherStatisticsResult, WeatherKitError>
Fetches WeatherKit monthly statistics for the given month range.
Sourcepub fn sun_events(
&self,
location: &CLLocation,
) -> Result<SunEvents, WeatherKitError>
pub fn sun_events( &self, location: &CLLocation, ) -> Result<SunEvents, WeatherKitError>
Returns today’s WeatherKit sun events from the daily forecast.
Sourcepub fn moon_events(
&self,
location: &CLLocation,
) -> Result<MoonEvents, WeatherKitError>
pub fn moon_events( &self, location: &CLLocation, ) -> Result<MoonEvents, WeatherKitError>
Returns today’s WeatherKit moon events from the daily forecast.
Sourcepub fn pressure(
&self,
location: &CLLocation,
) -> Result<Pressure, WeatherKitError>
pub fn pressure( &self, location: &CLLocation, ) -> Result<Pressure, WeatherKitError>
Returns the current WeatherKit pressure reading.
Trait Implementations§
Source§impl Clone for WeatherService
impl Clone for WeatherService
Source§fn clone(&self) -> WeatherService
fn clone(&self) -> WeatherService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more