pub struct NoaaClient { /* private fields */ }Expand description
Client for NOAA climate data
Implementations§
Source§impl NoaaClient
impl NoaaClient
Sourcepub fn new(api_token: Option<String>) -> Result<Self>
pub fn new(api_token: Option<String>) -> Result<Self>
Create a new NOAA client
§Arguments
api_token- NOAA API token (get from https://www.ncdc.noaa.gov/cdo-web/token)
Sourcepub async fn fetch_climate_data(
&self,
station_id: &str,
start_date: &str,
end_date: &str,
) -> Result<Vec<DataRecord>>
pub async fn fetch_climate_data( &self, station_id: &str, start_date: &str, end_date: &str, ) -> Result<Vec<DataRecord>>
Fetch climate data for a station
§Arguments
station_id- GHCND station ID (e.g., “GHCND:USW00094728” for NYC)start_date- Start date (YYYY-MM-DD)end_date- End date (YYYY-MM-DD)
Trait Implementations§
Source§impl DataSource for NoaaClient
impl DataSource for NoaaClient
Source§fn fetch_batch<'life0, 'async_trait>(
&'life0 self,
_cursor: Option<String>,
_batch_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DataRecord>, Option<String>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_batch<'life0, 'async_trait>(
&'life0 self,
_cursor: Option<String>,
_batch_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DataRecord>, Option<String>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a batch of records starting from cursor
Auto Trait Implementations§
impl Freeze for NoaaClient
impl !RefUnwindSafe for NoaaClient
impl Send for NoaaClient
impl Sync for NoaaClient
impl Unpin for NoaaClient
impl !UnwindSafe for NoaaClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more