pub struct SeriesDataRequest<'a> { /* private fields */ }Expand description
A builder for a GeoFRED / Maps series/data request, returned by
Client::series_data — one regional series’ values across regions, over
time.
Only series_id is required; with no date set FRED returns the most recent
date. Set an optional single date or a
start_date (which returns every date from
then on), and finish with send.
use ferric_fred::SeriesId;
let data = client
.series_data(&SeriesId::new("SMU56000000500000001"))
.send()
.await?;
println!("{} dates", data.meta.data.len());Implementations§
Source§impl<'a> SeriesDataRequest<'a>
impl<'a> SeriesDataRequest<'a>
Sourcepub fn date(self, date: NaiveDate) -> Self
pub fn date(self, date: NaiveDate) -> Self
Return data for a single date (date). With neither this nor
start_date set, FRED returns the most recent date.
Sourcepub fn start_date(self, start_date: NaiveDate) -> Self
pub fn start_date(self, start_date: NaiveDate) -> Self
Return data for every date from start_date onward.
Sourcepub async fn send(self) -> Result<RegionalData>
pub async fn send(self) -> Result<RegionalData>
Run the request and return the regional data.
§Errors
Returns an error if the request fails to send, FRED returns a non-success status, or the response body cannot be deserialized.
Trait Implementations§
Source§impl<'a> Clone for SeriesDataRequest<'a>
impl<'a> Clone for SeriesDataRequest<'a>
Source§fn clone(&self) -> SeriesDataRequest<'a>
fn clone(&self) -> SeriesDataRequest<'a>
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 moreAuto Trait Implementations§
impl<'a> !RefUnwindSafe for SeriesDataRequest<'a>
impl<'a> !UnwindSafe for SeriesDataRequest<'a>
impl<'a> Freeze for SeriesDataRequest<'a>
impl<'a> Send for SeriesDataRequest<'a>
impl<'a> Sync for SeriesDataRequest<'a>
impl<'a> Unpin for SeriesDataRequest<'a>
impl<'a> UnsafeUnpin for SeriesDataRequest<'a>
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