Last active
January 8, 2020 14:35
-
-
Save trimoq/c19df28a3cd0902f7746933d8d62812f to your computer and use it in GitHub Desktop.
The UserRepository with two imlementations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait UserRepository{ | |
fn store(&self, user: User); | |
fn load(&self, id: u32) -> Result<User,Error>; | |
} | |
struct PostgresUserRepository; | |
struct DummyUserRepository; | |
impl UserRepository for PostgresUserRepository{ | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment