pub trait Storage {
fn save(&self, item: &impl StoreObject) -> DBResult<usize>
where
Self: Sized;
fn get_all<T: StoreObject>(&self) -> DBResult<Vec<T>>
where
Self: Sized;
fn remove_by_filter<T: StoreObject>(
&self,
filter: Filter<'_>
) -> DBResult<usize>
where
Self: Sized;
fn get_by_statement<T: StoreObject>(
&self,
s: Statement<'_>
) -> DBResult<Vec<T>>
where
Self: Sized;
fn get_by_id<T: StoreObject>(&self, id: usize) -> DBResult<T>
where
Self: Sized,
{ ... }
fn get_by_filter<T: StoreObject>(&self, f: Filter<'_>) -> DBResult<Vec<T>>
where
Self: Sized,
{ ... }
fn get_with_max<T: StoreObject>(&self, f: &str) -> DBResult<Option<T>>
where
Self: Sized,
{ ... }
}