Trait DocumentRepo
Source pub trait DocumentRepo<T>: Send + Sync {
type Id: Send + Sync + Clone + 'static;
// Required methods
fn find_all(&self) -> DataFuture<'_, Result<Vec<T>, DataError>>;
fn find_by_id(
&self,
id: Self::Id,
) -> DataFuture<'_, Result<Option<T>, DataError>>;
fn insert(&self, doc: T) -> DataFuture<'_, Result<T, DataError>>;
fn update(
&self,
id: Self::Id,
doc: T,
) -> DataFuture<'_, Result<T, DataError>>;
fn delete(&self, id: Self::Id) -> DataFuture<'_, Result<(), DataError>>;
}