pub struct ReleaseTablesRequest<'a> { /* private fields */ }Expand description
A builder for a release/tables request, returned by
Client::release_tables. Fetches a release’s table tree — the whole tree
by default, or the subtree rooted at one element via
element. Finish with
send.
use ferric_fred::ReleaseId;
let table = client.release_tables(ReleaseId::new(10)).send().await?;
println!("{} root elements", table.roots.len());Implementations§
Source§impl<'a> ReleaseTablesRequest<'a>
impl<'a> ReleaseTablesRequest<'a>
Sourcepub fn element(self, element_id: ReleaseElementId) -> Self
pub fn element(self, element_id: ReleaseElementId) -> Self
Fetch only the subtree rooted at this element (element_id), instead of
the release’s whole table tree.
Sourcepub fn include_observation_values(self, include: bool) -> Self
pub fn include_observation_values(self, include: bool) -> Self
Fold each series element’s observation value into the returned tree
(populating [ReleaseTableElement::observation_value] and
observation_date). Off
by default — the tree is structure-only. Without an explicit
observation_date, FRED returns
its latest value for each series.
Sourcepub fn observation_date(self, date: NaiveDate) -> Self
pub fn observation_date(self, date: NaiveDate) -> Self
Request observation values as of this date (ISO YYYY-MM-DD). Implies
include_observation_values(true),
since a date is meaningless without values. FRED formats the returned
per-element observation_date to each series’ frequency.
Sourcepub async fn send(self) -> Result<ReleaseTable>
pub async fn send(self) -> Result<ReleaseTable>
Run the request and return the (sub)tree.
§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 ReleaseTablesRequest<'a>
impl<'a> Clone for ReleaseTablesRequest<'a>
Source§fn clone(&self) -> ReleaseTablesRequest<'a>
fn clone(&self) -> ReleaseTablesRequest<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more