pub struct OpenWeather {
pub api_key: String,
pub units: Units,
}
Fields§
§api_key: String
§units: Units
Implementations§
Source§impl OpenWeather
impl OpenWeather
pub async fn new( api_key: &str, units: Units, ) -> Result<OpenWeather, Box<dyn Error>>
pub async fn get_by_city(&self, city: &str) -> Result<Weather, Box<dyn Error>>
pub async fn get_by_city_and_country( &self, city: &str, country: &str, ) -> Result<Weather, Box<dyn Error>>
pub async fn get_by_coordinates( &self, lat: f32, lon: f32, ) -> Result<Weather, Box<dyn Error>>
pub async fn get_by_zipcode( &self, zipcode: u32, country: &str, ) -> Result<Weather, Box<dyn Error>>
pub async fn get_by_cities_in_zone( &self, lon1: f32, lat1: f32, lon2: f32, lat2: f32, zoom: u32, ) -> Result<WeatherMultiple, Box<dyn Error>>
pub async fn get_by_cities_in_cycle( &self, lon: f32, lat: f32, count: u32, ) -> Result<WeatherMultiple, Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for OpenWeather
impl RefUnwindSafe for OpenWeather
impl Send for OpenWeather
impl Sync for OpenWeather
impl Unpin for OpenWeather
impl UnwindSafe for OpenWeather
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