nest_data_source_api/
data_source.rs1use crate::api::ApiError;
2use crate::messages::{ActivityRequest, ActivityResponse, ParticipantRequest, ParticipantResponse};
3use async_trait::async_trait;
4
5#[async_trait]
6pub trait DataSource: Send + Sync + 'static {
7 async fn create_local_participant(
9 &self,
10 request: ParticipantRequest,
11 ) -> Result<Option<ParticipantResponse>, ApiError>;
12
13 async fn update_local_participant(
15 &self,
16 request: ParticipantRequest,
17 ) -> Result<Option<ParticipantResponse>, ApiError>;
18
19 async fn delete_local_participant(
21 &self,
22 request: ParticipantRequest,
23 ) -> Result<Option<ParticipantResponse>, ApiError>;
24
25 async fn local_participant_details(
27 &self,
28 request: ParticipantRequest,
29 ) -> Result<Option<ParticipantResponse>, ApiError>;
30
31 async fn create_participant_activity(
33 &self,
34 request: ActivityRequest,
35 ) -> Result<Option<ActivityResponse>, ApiError>;
36
37 async fn update_participant_activity(
39 &self,
40 request: ActivityRequest,
41 ) -> Result<Option<ActivityResponse>, ApiError>;
42
43 async fn delete_participant_activity(
45 &self,
46 request: ActivityRequest,
47 ) -> Result<Option<ActivityResponse>, ApiError>;
48
49 async fn participant_activity_details(
52 &self,
53 request: ActivityRequest,
54 ) -> Result<Option<ActivityResponse>, ApiError>;
55
56 async fn participant_activity_progress(
59 &self,
60 request: ActivityRequest,
61 ) -> Result<Option<ActivityResponse>, ApiError>;
62
63 async fn participant_activity_result(
67 &self,
68 request: ActivityRequest,
69 ) -> Result<Option<ActivityResponse>, ApiError>;
70
71 }