Trait ResourceTable
Source pub trait ResourceTable {
Show 13 methods
// Required methods
fn create(&mut self, entity: &Resource) -> Result<Resource, RepositoryError>;
fn create_multi(
&mut self,
entities: &[Resource],
) -> Result<Vec<Resource>, RepositoryError>;
fn get(&self, id: &EntityId) -> Result<Option<Resource>, RepositoryError>;
fn get_multi(
&self,
ids: &[EntityId],
) -> Result<Vec<Option<Resource>>, RepositoryError>;
fn get_all(&self) -> Result<Vec<Resource>, RepositoryError>;
fn update(&mut self, entity: &Resource) -> Result<Resource, RepositoryError>;
fn update_multi(
&mut self,
entities: &[Resource],
) -> Result<Vec<Resource>, RepositoryError>;
fn update_with_relationships(
&mut self,
entity: &Resource,
) -> Result<Resource, RepositoryError>;
fn update_with_relationships_multi(
&mut self,
entities: &[Resource],
) -> Result<Vec<Resource>, RepositoryError>;
fn remove(&mut self, id: &EntityId) -> Result<(), RepositoryError>;
fn remove_multi(&mut self, ids: &[EntityId]) -> Result<(), RepositoryError>;
fn snapshot_rows(
&self,
ids: &[EntityId],
) -> Result<TableLevelSnapshot, RepositoryError>;
fn restore_rows(
&mut self,
snap: &TableLevelSnapshot,
) -> Result<(), RepositoryError>;
}