pub trait UsersRepository {
// Required method
fn get_user_by_id<'life0, 'async_trait>(
&'life0 self,
id: u64,
) -> Pin<Box<dyn Future<Output = Result<User>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Defines the interface for user-related database operations.
This trait provides a contract for implementing user repository operations, allowing for different implementations (like production database, mock for testing).
Required Methods§
Implementors§
impl UsersRepository for Database
Implementation of UsersRepository for the main database.
This implementation provides the actual database operations using SQLx to interact with the underlying database.
impl UsersRepository for MockUsersRepository
Defines the interface for user-related database operations.
This trait provides a contract for implementing user repository operations, allowing for different implementations (like production database, mock for testing).