pub struct EconomicIndicator { /* private fields */ }Expand description
A macro-economic data series backed by configured data providers.
Created via Providers::economic.
Implementations§
Source§impl EconomicIndicator
impl EconomicIndicator
Sourcepub fn cache(self, ttl: Duration) -> Self
pub fn cache(self, ttl: Duration) -> Self
Cache responses for ttl instead of the default 60 seconds,
deduplicating concurrent identical requests.
Sourcepub fn cache_forever(self) -> Self
pub fn cache_forever(self) -> Self
Cache responses for the handle’s lifetime instead of the default 60 seconds.
Source§impl EconomicIndicator
impl EconomicIndicator
Sourcepub async fn series(&self) -> Result<EconomicSeries>
pub async fn series(&self) -> Result<EconomicSeries>
Fetch the full data series for this economic indicator.
Sourcepub async fn as_of(&self, date: &str) -> Result<EconomicSeries>
pub async fn as_of(&self, date: &str) -> Result<EconomicSeries>
Fetch this series as it stood on date (YYYY-MM-DD) instead of as
currently revised (FRED only, via ALFRED’s realtime window).
Macro data is revised after publication, so backtesting a rule against
today’s series is look-ahead bias: the values it trades on were not
knowable at the time. This returns the vintage actually published as of
date. Cached per date.
Auto Trait Implementations§
impl !Freeze for EconomicIndicator
impl !RefUnwindSafe for EconomicIndicator
impl !UnwindSafe for EconomicIndicator
impl Send for EconomicIndicator
impl Sync for EconomicIndicator
impl Unpin for EconomicIndicator
impl UnsafeUnpin for EconomicIndicator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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