We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98f2b93 commit 92b2ea3Copy full SHA for 92b2ea3
src/core/factory.rs
@@ -3,13 +3,7 @@ use async_trait::async_trait;
3
use super::db;
4
5
#[async_trait]
6
-pub trait ModelFactory {
7
- type Request;
8
- type Model;
9
-
10
- fn factory_build() -> Self::Request;
11
- async fn factory_create(
12
- obj: Option<Self::Request>,
13
- pool: db::PgPool,
14
- ) -> Result<Self::Model, db::Error>;
+pub trait ModelFactory<Model, NewModel> {
+ fn build() -> NewModel;
+ async fn create(obj: Option<NewModel>, pool: db::PgPool) -> Result<Model, db::Error>;
15
}
0 commit comments