]> Untitled Git - lemmy.git/blob - crates/api_crud/src/lib.rs
edd5c46f2e18a89ca3585d5a9b65472ed4c91ef0
[lemmy.git] / crates / api_crud / src / lib.rs
1 use actix_web::web::Data;
2 use lemmy_api_common::context::LemmyContext;
3 use lemmy_utils::error::LemmyError;
4
5 pub mod comment;
6 pub mod community;
7 pub mod custom_emoji;
8 pub mod post;
9 pub mod private_message;
10 pub mod site;
11 pub mod user;
12
13 #[async_trait::async_trait(?Send)]
14 pub trait PerformCrud {
15   type Response: serde::ser::Serialize + Send + Clone + Sync;
16
17   async fn perform(&self, context: &Data<LemmyContext>) -> Result<Self::Response, LemmyError>;
18 }