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 fn new() -> AnalyticsQuery
pub fn new() -> AnalyticsQuery
Create a new analytics query with defaults
Sourcepub const fn period(self, period: TimePeriod) -> AnalyticsQuery
pub const fn period(self, period: TimePeriod) -> AnalyticsQuery
Set a predefined time period
Sourcepub const fn date_range(
self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> AnalyticsQuery
pub const fn date_range( self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> AnalyticsQuery
Set a custom date range and switch to custom period
Sourcepub const fn granularity(self, granularity: TimeGranularity) -> AnalyticsQuery
pub const fn granularity(self, granularity: TimeGranularity) -> AnalyticsQuery
Set the time granularity for time-series results
Sourcepub const fn limit(self, limit: u32) -> AnalyticsQuery
pub const fn limit(self, limit: u32) -> AnalyticsQuery
Limit the number of results returned
Sourcepub const fn compare_previous(self, compare: bool) -> AnalyticsQuery
pub const fn compare_previous(self, compare: bool) -> AnalyticsQuery
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<AnalyticsQuery, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnalyticsQuery, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for AnalyticsQuery
impl Serialize for AnalyticsQuery
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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