pub trait ActivityReadOps {
    // Required methods
    fn read_activity(
        &self,
        activity_id: ActivityGuid
    ) -> PaceResult<ActivityItem>;
    fn list_activities(
        &self,
        filter: ActivityStatusFilter
    ) -> PaceOptResult<FilteredActivities>;
}
Expand description

Basic Read Operations for Activities in the storage backend.

Read operations are essential for loading activities from the storage backend. These operations are used to get activities by their ID, list all activities, or filter activities by a specific criterion. They are also used to get the current state of activities, such as the currently active activities.

Required Methods§

source

fn read_activity(&self, activity_id: ActivityGuid) -> PaceResult<ActivityItem>

Read an activity from the storage backend.

§Arguments
  • activity_id - The ID of the activity to read.
§Errors

This function should return an error if the activity cannot be read.

§Returns

The activity that was read from the storage backend. If no activity is found, it should return Ok(None).

source

fn list_activities( &self, filter: ActivityStatusFilter ) -> PaceOptResult<FilteredActivities>

List activities from the storage backend.

§Arguments
  • filter - The filter to apply to the activities.
§Errors

This function should return an error if the activities cannot be loaded.

§Returns

A collection of the activities that were loaded from the storage backend. Returns Ok(None) if no activities are found.

Implementors§