Skip to main content

weatherkit/
lib.rs

1#![doc = include_str!("../README.md")]
2//! Safe Rust bindings for WeatherKit.
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![allow(
5    clippy::cargo_common_metadata,
6    clippy::cast_precision_loss,
7    clippy::doc_markdown,
8    clippy::missing_const_for_fn,
9    clippy::missing_errors_doc,
10    clippy::missing_panics_doc,
11    clippy::module_name_repetitions,
12    clippy::must_use_candidate,
13    clippy::needless_pass_by_value,
14    clippy::redundant_pub_crate,
15    clippy::return_self_not_must_use,
16    clippy::struct_field_names,
17    clippy::type_complexity,
18    clippy::use_self
19)]
20
21pub mod availability_kind;
22pub mod changes;
23pub mod current_weather;
24pub mod daily_forecast;
25pub mod error;
26/// Low-level WeatherKit bridge bindings.
27pub mod ffi;
28pub mod hourly_forecast;
29pub mod minute_forecast;
30pub mod moon_events;
31pub mod pressure;
32mod private;
33pub mod service;
34pub mod statistics;
35pub mod sun_events;
36pub mod weather;
37pub mod weather_alert;
38
39#[cfg(feature = "async")]
40pub mod async_api;
41pub mod weather_attribution;
42pub mod weather_condition;
43
44pub use availability_kind::{AvailabilityKind, AvailabilityKindDescriptor, WeatherAvailability};
45pub use changes::{
46    Deviation, HistoricalComparison, HistoricalComparisons, LengthUnit, Percentiles,
47    TemperatureUnit, Trend, TrendBaseline, TrendBaselineKind, WeatherChange,
48    WeatherChangeDirection, WeatherChanges,
49};
50pub use current_weather::{
51    CloudCoverByAltitude, CurrentWeather, UVExposureCategory, UVExposureCategoryDescriptor,
52    UVIndex, Wind, WindCompassDirection, WindCompassDirectionDescriptor,
53};
54pub use daily_forecast::{
55    DailyForecast, DayForecast, DayPartForecast, PrecipitationAmountByType, SnowfallAmount,
56};
57pub use error::{
58    WeatherError, WeatherErrorDescriptor, WeatherKitError, WEATHERKIT_BRIDGE_ERROR_DOMAIN,
59};
60pub use hourly_forecast::{HourForecast, HourlyForecast};
61pub use minute_forecast::{MinuteForecast, MinuteForecastCollection};
62pub use moon_events::{MoonEvents, MoonPhase, MoonPhaseDescriptor};
63pub use pressure::{Pressure, PressureTrend, PressureTrendDescriptor};
64pub use service::{
65    CLLocation, DateInterval, Weather, WeatherMetadata, WeatherQuery, WeatherQueryResult,
66    WeatherService,
67};
68pub use statistics::{
69    DailyWeatherStatistics, DailyWeatherStatisticsQuery, DailyWeatherStatisticsResult,
70    DailyWeatherSummary, DailyWeatherSummaryQuery, DailyWeatherSummaryResult,
71    DayPrecipitationStatistics, DayPrecipitationSummary, DayTemperatureStatistics,
72    DayTemperatureSummary, HourTemperatureStatistics, HourlyWeatherStatistics,
73    HourlyWeatherStatisticsQuery, MonthPrecipitationStatistics, MonthTemperatureStatistics,
74    MonthlyWeatherStatistics, MonthlyWeatherStatisticsQuery, MonthlyWeatherStatisticsResult,
75};
76pub use sun_events::SunEvents;
77pub use weather_alert::{WeatherAlert, WeatherSeverity, WeatherSeverityDescriptor};
78pub use weather_attribution::WeatherAttribution;
79pub use weather_condition::{
80    Precipitation, PrecipitationDescriptor, WeatherCondition, WeatherConditionDescriptor,
81};
82
83/// Common imports.
84pub mod prelude {
85    pub use crate::availability_kind::{
86        AvailabilityKind, AvailabilityKindDescriptor, WeatherAvailability,
87    };
88    pub use crate::changes::{
89        Deviation, HistoricalComparison, HistoricalComparisons, LengthUnit, Percentiles,
90        TemperatureUnit, Trend, TrendBaseline, TrendBaselineKind, WeatherChange,
91        WeatherChangeDirection, WeatherChanges,
92    };
93    pub use crate::current_weather::{
94        CloudCoverByAltitude, CurrentWeather, UVExposureCategory, UVExposureCategoryDescriptor,
95        UVIndex, Wind, WindCompassDirection, WindCompassDirectionDescriptor,
96    };
97    pub use crate::daily_forecast::{
98        DailyForecast, DayForecast, DayPartForecast, PrecipitationAmountByType, SnowfallAmount,
99    };
100    pub use crate::error::{
101        WeatherError, WeatherErrorDescriptor, WeatherKitError, WEATHERKIT_BRIDGE_ERROR_DOMAIN,
102    };
103    pub use crate::hourly_forecast::{HourForecast, HourlyForecast};
104    pub use crate::minute_forecast::{MinuteForecast, MinuteForecastCollection};
105    pub use crate::moon_events::{MoonEvents, MoonPhase, MoonPhaseDescriptor};
106    pub use crate::pressure::{Pressure, PressureTrend, PressureTrendDescriptor};
107    pub use crate::service::{
108        CLLocation, DateInterval, Weather, WeatherMetadata, WeatherQuery, WeatherQueryResult,
109        WeatherService,
110    };
111    pub use crate::statistics::{
112        DailyWeatherStatistics, DailyWeatherStatisticsQuery, DailyWeatherStatisticsResult,
113        DailyWeatherSummary, DailyWeatherSummaryQuery, DailyWeatherSummaryResult,
114        DayPrecipitationStatistics, DayPrecipitationSummary, DayTemperatureStatistics,
115        DayTemperatureSummary, HourTemperatureStatistics, HourlyWeatherStatistics,
116        HourlyWeatherStatisticsQuery, MonthPrecipitationStatistics, MonthTemperatureStatistics,
117        MonthlyWeatherStatistics, MonthlyWeatherStatisticsQuery, MonthlyWeatherStatisticsResult,
118    };
119    pub use crate::sun_events::SunEvents;
120    pub use crate::weather_alert::{WeatherAlert, WeatherSeverity, WeatherSeverityDescriptor};
121    pub use crate::weather_attribution::WeatherAttribution;
122    pub use crate::weather_condition::{
123        Precipitation, PrecipitationDescriptor, WeatherCondition, WeatherConditionDescriptor,
124    };
125}