pub struct UserRepository { /* private fields */ }Implementations§
Source§impl UserRepository
impl UserRepository
pub fn new(db: Arc<RwLock<dyn DatabaseInterface>>) -> Self
Trait Implementations§
Source§impl Repository<User> for UserRepository
impl Repository<User> for UserRepository
fn get_db(&self) -> Arc<RwLock<dyn DatabaseInterface>>
fn create(&self, new_entity: NewUser) -> Result<User, GameRepositoryError>
fn find(&self, id: i64) -> Result<Option<User>, GameRepositoryError>
fn save(&self, entity: User) -> Result<User, GameRepositoryError>
fn delete(&self, entity: User) -> Result<bool, GameRepositoryError>
fn get_connection( &self, ) -> Result<PooledConnection<ConnectionManager<PgConnection>>, GameDatabaseError>
Source§impl UserRepositoryInterface for UserRepository
impl UserRepositoryInterface for UserRepository
fn find_by_external_id( &self, external_id: i64, ) -> Result<Option<User>, GameRepositoryError>
fn find_unlocked_locations( &self, id: i64, ) -> Result<Vec<UserLocation>, GameRepositoryError>
fn find_unlocked_location_ids( &self, id: i64, ) -> Result<Vec<i32>, GameRepositoryError>
fn unlock_location( &self, id: i64, location_id: i32, ) -> Result<UserLocation, GameRepositoryError>
Auto Trait Implementations§
impl Freeze for UserRepository
impl RefUnwindSafe for UserRepository
impl Send for UserRepository
impl Sync for UserRepository
impl Unpin for UserRepository
impl UnwindSafe for UserRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read more