pub trait UserRepository: Send + Sync {
// Required methods
fn find_by_id(&self, id: u32) -> Option<String>;
fn create(&self, name: &str) -> Result<u32, String>;
}
Expand description
Example repository trait
pub trait UserRepository: Send + Sync {
// Required methods
fn find_by_id(&self, id: u32) -> Option<String>;
fn create(&self, name: &str) -> Result<u32, String>;
}
Example repository trait