fc5b566feat: repository ports and in-memory implementations1mo | 1 | use super::RepositoryResult; |
| 2 | use crate::domain::{Email, User, UserId}; |
| 3 | |
| 4 | |
| 5 | pub trait UserRepository: Send + Sync { |
| 6 | |
| 7 | fn find_by_id( |
| 8 | &self, |
| 9 | id: &UserId, |
| 10 | ) -> impl Future<Output = RepositoryResult<Option<User>>> + Send; |
| 11 | |
| 12 | |
| 13 | fn find_by_email( |
| 14 | &self, |
| 15 | email: &Email, |
| 16 | ) -> impl Future<Output = RepositoryResult<Option<User>>> + Send; |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | fn save(&self, user: &User) -> impl Future<Output = RepositoryResult<()>> + Send; |
| 23 | |
| 24 | |
| 25 | fn any_exist(&self) -> impl Future<Output = RepositoryResult<bool>> + Send; |
8ed4e5afeat: the root is the owner's profile1d | 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | fn sole_user(&self) -> impl Future<Output = RepositoryResult<Option<User>>> + Send; |
fc5b566feat: repository ports and in-memory implementations1mo | 36 | } |