pub struct AnalyticsQuery {
pub period: Option<TimePeriod>,
pub date_range: Option<DateRange>,
pub granularity: Option<TimeGranularity>,
pub limit: Option<u32>,
pub compare_previous: Option<bool>,
}Expand description
Common analytics query parameters
Fields§
§period: Option<TimePeriod>Time period preset
date_range: Option<DateRange>Custom date range (used when period is Custom)
granularity: Option<TimeGranularity>Time granularity for time-series data
limit: Option<u32>Number of results to return (for top-N queries)
compare_previous: Option<bool>Compare to previous period
Implementations§
Source§impl AnalyticsQuery
impl AnalyticsQuery
Sourcepub const fn period(self, period: TimePeriod) -> Self
pub const fn period(self, period: TimePeriod) -> Self
Set a predefined time period
Sourcepub const fn date_range(self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self
pub const fn date_range(self, start: DateTime<Utc>, end: DateTime<Utc>) -> Self
Set a custom date range and switch to custom period
Sourcepub const fn granularity(self, granularity: TimeGranularity) -> Self
pub const fn granularity(self, granularity: TimeGranularity) -> Self
Set the time granularity for time-series results
Sourcepub const fn compare_previous(self, compare: bool) -> Self
pub const fn compare_previous(self, compare: bool) -> Self
Enable or disable comparison to the previous period
Trait Implementations§
Source§impl Clone for AnalyticsQuery
impl Clone for AnalyticsQuery
Source§fn clone(&self) -> AnalyticsQuery
fn clone(&self) -> AnalyticsQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AnalyticsQuery
impl Debug for AnalyticsQuery
Source§impl Default for AnalyticsQuery
impl Default for AnalyticsQuery
Source§fn default() -> AnalyticsQuery
fn default() -> AnalyticsQuery
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AnalyticsQuery
impl<'de> Deserialize<'de> for AnalyticsQuery
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 AnalyticsQuery
impl RefUnwindSafe for AnalyticsQuery
impl Send for AnalyticsQuery
impl Sync for AnalyticsQuery
impl Unpin for AnalyticsQuery
impl UnsafeUnpin for AnalyticsQuery
impl UnwindSafe for AnalyticsQuery
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