pub struct ItemRepository { /* private fields */ }Implementations§
Source§impl ItemRepository
impl ItemRepository
pub fn new(db: Arc<RwLock<dyn DatabaseInterface>>) -> Self
Trait Implementations§
Source§impl ItemRepositoryInterface for ItemRepository
impl ItemRepositoryInterface for ItemRepository
fn find_by_user(&self, user_id: i64) -> Result<Vec<Item>, GameRepositoryError>
fn find_by_type_and_user( &self, type_id: i32, user_id: i64, ) -> Result<Vec<Item>, GameRepositoryError>
Source§impl Repository<Item> for ItemRepository
impl Repository<Item> for ItemRepository
fn get_db(&self) -> Arc<RwLock<dyn DatabaseInterface>>
fn create(&self, new_entity: NewItem) -> Result<Item, GameRepositoryError>
fn find(&self, id: i64) -> Result<Option<Item>, GameRepositoryError>
fn save(&self, entity: Item) -> Result<Item, GameRepositoryError>
fn delete(&self, entity: Item) -> Result<bool, GameRepositoryError>
fn get_connection( &self, ) -> Result<PooledConnection<ConnectionManager<PgConnection>>, GameDatabaseError>
Auto Trait Implementations§
impl Freeze for ItemRepository
impl RefUnwindSafe for ItemRepository
impl Send for ItemRepository
impl Sync for ItemRepository
impl Unpin for ItemRepository
impl UnwindSafe for ItemRepository
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