pub struct EventQuery {
pub currencies: Vec<String>,
pub from_date: Option<NaiveDate>,
pub to_date: Option<NaiveDate>,
pub min_impact: Option<Impact>,
}Expand description
Query parameters for filtering economic events.
Fields§
§currencies: Vec<String>Filter by currencies (empty means all currencies) For currency pairs like “AUD/CHF”, both currencies are included
from_date: Option<NaiveDate>Start date for the query range
to_date: Option<NaiveDate>End date for the query range
min_impact: Option<Impact>Minimum impact level (defaults to Low if not specified)
Implementations§
Source§impl EventQuery
impl EventQuery
Sourcepub fn with_currency_pair(self, pair: &str) -> Self
pub fn with_currency_pair(self, pair: &str) -> Self
Set currencies from a currency pair string (e.g., “AUD/CHF”) Extracts both currencies from the pair
Sourcepub fn with_currency(self, currency: &str) -> Self
pub fn with_currency(self, currency: &str) -> Self
Set a single currency
Sourcepub fn with_currencies(self, currencies: Vec<String>) -> Self
pub fn with_currencies(self, currencies: Vec<String>) -> Self
Set multiple currencies
Sourcepub fn with_date_range(self, from: NaiveDate, to: NaiveDate) -> Self
pub fn with_date_range(self, from: NaiveDate, to: NaiveDate) -> Self
Set the date range
Sourcepub fn with_week_around(self, date: NaiveDate) -> Self
pub fn with_week_around(self, date: NaiveDate) -> Self
Set the week around a specific date (3 days before and after)
Sourcepub fn with_min_impact(self, impact: Impact) -> Self
pub fn with_min_impact(self, impact: Impact) -> Self
Set minimum impact level
Sourcepub fn with_min_stars(self, stars: u8) -> Self
pub fn with_min_stars(self, stars: u8) -> Self
Set minimum impact level by star rating (1-3)
Sourcepub fn datetime_in_range(&self, datetime: &DateTime<Local>) -> bool
pub fn datetime_in_range(&self, datetime: &DateTime<Local>) -> bool
Check if an event’s datetime falls within the query date range
Trait Implementations§
Source§impl Clone for EventQuery
impl Clone for EventQuery
Source§fn clone(&self) -> EventQuery
fn clone(&self) -> EventQuery
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventQuery
impl Debug for EventQuery
Source§impl Default for EventQuery
impl Default for EventQuery
Source§fn default() -> EventQuery
fn default() -> EventQuery
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EventQuery
impl<'de> Deserialize<'de> for EventQuery
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EventQuery
impl RefUnwindSafe for EventQuery
impl Send for EventQuery
impl Sync for EventQuery
impl Unpin for EventQuery
impl UnwindSafe for EventQuery
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