struct DBRepository<T: RepositoryItem> {
database: SqliteDatabase,
_marker: PhantomData<T>,
}Fields§
§database: SqliteDatabase§_marker: PhantomData<T>Trait Implementations§
Source§impl<V: RepositoryItem> Repository<V> for DBRepository<V>
impl<V: RepositoryItem> Repository<V> for DBRepository<V>
Source§fn get<'life0, 'async_trait>(
&'life0 self,
key: V::Key,
) -> Pin<Box<dyn Future<Output = Result<Option<V>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
key: V::Key,
) -> Pin<Box<dyn Future<Output = Result<Option<V>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves an item from the repository by its key.
Source§fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<V>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<V>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists all items in the repository.
Source§fn set<'life0, 'async_trait>(
&'life0 self,
key: V::Key,
value: V,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set<'life0, 'async_trait>(
&'life0 self,
key: V::Key,
value: V,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets an item in the repository with the specified key.
Source§fn set_bulk<'life0, 'async_trait>(
&'life0 self,
values: Vec<(V::Key, V)>,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_bulk<'life0, 'async_trait>(
&'life0 self,
values: Vec<(V::Key, V)>,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets multiple items in the repository.
Source§fn remove<'life0, 'async_trait>(
&'life0 self,
key: V::Key,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove<'life0, 'async_trait>(
&'life0 self,
key: V::Key,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes an item from the repository by its key.
Source§fn remove_bulk<'life0, 'async_trait>(
&'life0 self,
keys: Vec<V::Key>,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_bulk<'life0, 'async_trait>(
&'life0 self,
keys: Vec<V::Key>,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes multiple items from the repository by their keys.
Source§fn remove_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes all items from the repository.
Auto Trait Implementations§
impl<T> Freeze for DBRepository<T>
impl<T> !RefUnwindSafe for DBRepository<T>
impl<T> Send for DBRepository<T>
impl<T> Sync for DBRepository<T>
impl<T> Unpin for DBRepository<T>where
T: Unpin,
impl<T> UnsafeUnpin for DBRepository<T>
impl<T> !UnwindSafe for DBRepository<T>
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more