pub struct MarketCalendar { /* private fields */ }Expand description
Market-wide event calendars backed by configured data providers.
Routes through Capability::CALENDAR. Unlike
Ticker::calendar, which builds a per-symbol
timeline, these span the whole market over a date range.
Created via Providers::calendar.
Implementations§
Source§impl MarketCalendar
impl MarketCalendar
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 MarketCalendar
impl MarketCalendar
Sourcepub async fn fetch(
&self,
kind: CalendarKind,
from: &str,
to: &str,
) -> Result<Vec<MarketCalendarEntry>>
pub async fn fetch( &self, kind: CalendarKind, from: &str, to: &str, ) -> Result<Vec<MarketCalendarEntry>>
Fetch a calendar of kind over [from, to] (YYYY-MM-DD dates).
Cached per (kind, from, to).
Sourcepub async fn earnings(
&self,
from: &str,
to: &str,
) -> Result<Vec<MarketCalendarEntry>>
pub async fn earnings( &self, from: &str, to: &str, ) -> Result<Vec<MarketCalendarEntry>>
Earnings releases scheduled or reported over [from, to].
Sourcepub async fn ipos(
&self,
from: &str,
to: &str,
) -> Result<Vec<MarketCalendarEntry>>
pub async fn ipos( &self, from: &str, to: &str, ) -> Result<Vec<MarketCalendarEntry>>
Initial public offerings over [from, to].
Sourcepub async fn dividends(
&self,
from: &str,
to: &str,
) -> Result<Vec<MarketCalendarEntry>>
pub async fn dividends( &self, from: &str, to: &str, ) -> Result<Vec<MarketCalendarEntry>>
Dividend payments over [from, to].
Sourcepub async fn splits(
&self,
from: &str,
to: &str,
) -> Result<Vec<MarketCalendarEntry>>
pub async fn splits( &self, from: &str, to: &str, ) -> Result<Vec<MarketCalendarEntry>>
Stock splits over [from, to].
Sourcepub async fn economic(
&self,
from: &str,
to: &str,
) -> Result<Vec<MarketCalendarEntry>>
pub async fn economic( &self, from: &str, to: &str, ) -> Result<Vec<MarketCalendarEntry>>
Macro-economic releases over [from, to].
Sourcepub async fn holidays(&self) -> Result<Vec<MarketCalendarEntry>>
pub async fn holidays(&self) -> Result<Vec<MarketCalendarEntry>>
Upcoming market holidays and early closes. Providers return their upcoming set, so no date range is taken.
Sourcepub async fn market_status(&self) -> Result<Vec<MarketCalendarEntry>>
pub async fn market_status(&self) -> Result<Vec<MarketCalendarEntry>>
Live open/closed status per exchange. A snapshot rather than a dated event, so no date range is taken. Currently Alpha Vantage only.
Auto Trait Implementations§
impl !Freeze for MarketCalendar
impl !RefUnwindSafe for MarketCalendar
impl !UnwindSafe for MarketCalendar
impl Send for MarketCalendar
impl Sync for MarketCalendar
impl Unpin for MarketCalendar
impl UnsafeUnpin for MarketCalendar
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
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> ⓘ
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> ⓘ
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