pub struct CalendarService { /* private fields */ }Expand description
High-level service for fetching and querying economic events.
Implementations§
Source§impl CalendarService
impl CalendarService
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new calendar service.
On native targets, automatically detects the system timezone.
On WASM targets, falls back to UTC unless you use with_timezone().
Sourcepub fn with_timezone(timezone: &str) -> Result<Self>
pub fn with_timezone(timezone: &str) -> Result<Self>
Sourcepub async fn query_events(
&self,
query: &EventQuery,
) -> Result<Vec<EconomicEvent>>
pub async fn query_events( &self, query: &EventQuery, ) -> Result<Vec<EconomicEvent>>
Query events matching the given criteria.
Sourcepub async fn get_today_events(&self) -> Result<Vec<EconomicEvent>>
pub async fn get_today_events(&self) -> Result<Vec<EconomicEvent>>
Get events for today.
Sourcepub async fn get_week_events(&self) -> Result<Vec<EconomicEvent>>
pub async fn get_week_events(&self) -> Result<Vec<EconomicEvent>>
Get events for this week.
Sourcepub async fn get_week_events_for(
&self,
date: NaiveDate,
) -> Result<Vec<EconomicEvent>>
pub async fn get_week_events_for( &self, date: NaiveDate, ) -> Result<Vec<EconomicEvent>>
Get events for a specific week containing the given date.
Auto Trait Implementations§
impl Freeze for CalendarService
impl !RefUnwindSafe for CalendarService
impl Send for CalendarService
impl Sync for CalendarService
impl Unpin for CalendarService
impl !UnwindSafe for CalendarService
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