pub trait UserAchievementRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
user_achievement: &'life1 UserAchievement,
) -> Pin<Box<dyn Future<Output = Result<UserAchievement, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserAchievement>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserAchievement>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_user_and_achievement<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
achievement_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserAchievement>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
user_achievement: &'life1 UserAchievement,
) -> Pin<Box<dyn Future<Output = Result<UserAchievement, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_total_points<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i32, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_recent_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
limit: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserAchievement>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Repository trait for UserAchievement persistence operations
Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
user_achievement: &'life1 UserAchievement,
) -> Pin<Box<dyn Future<Output = Result<UserAchievement, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
user_achievement: &'life1 UserAchievement,
) -> Pin<Box<dyn Future<Output = Result<UserAchievement, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Award achievement to user
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserAchievement>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserAchievement>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find user achievement by ID
Sourcefn find_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserAchievement>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_user<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserAchievement>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all achievements earned by a user
Sourcefn find_by_user_and_achievement<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
achievement_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserAchievement>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_user_and_achievement<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
achievement_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserAchievement>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find specific user achievement
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
user_achievement: &'life1 UserAchievement,
) -> Pin<Box<dyn Future<Output = Result<UserAchievement, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
user_achievement: &'life1 UserAchievement,
) -> Pin<Box<dyn Future<Output = Result<UserAchievement, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update user achievement (for repeatable achievements)
Sourcefn calculate_total_points<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i32, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn calculate_total_points<'life0, 'async_trait>(
&'life0 self,
user_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i32, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Calculate total points for user