Trait pace_core::ActivityQuerying
source · pub trait ActivityQuerying: ActivityReadOps {
// Required methods
fn find_activities_in_date_range(
&self,
start_date: NaiveDate,
end_date: NaiveDate
) -> PaceResult<ActivityLog>;
fn list_activities_by_id(
&self
) -> PaceOptResult<BTreeMap<ActivityGuid, Activity>>;
fn latest_active_activity(&self) -> PaceOptResult<Activity>;
// Provided method
fn list_current_activities(&self) -> PaceOptResult<ActivityLog> { ... }
}Expand description
Querying Activities
Querying activities is a way to get information about them from the storage backend. This is useful for getting a list of activities, finding activities within a specific date range, or getting activities by their ID.
For example, you might want to list all activities that are currently active, find all activities within a specific date range, or get a specific activity by its ID.
Required Methods§
sourcefn find_activities_in_date_range(
&self,
start_date: NaiveDate,
end_date: NaiveDate
) -> PaceResult<ActivityLog>
fn find_activities_in_date_range( &self, start_date: NaiveDate, end_date: NaiveDate ) -> PaceResult<ActivityLog>
Find activities within a specific date range.
§Arguments
start_date- The start date of the range.end_date- The end date of the range.
§Errors
This function should return an error if the activities cannot be loaded.
§Returns
A collection of the activities that fall within the specified date range.