Skip to main content

DocumentTable

pub trait DocumentTable {
Show 21 methods // Required methods fn create(&mut self, entity: &Document) -> Result<Document, RepositoryError>; fn create_multi( &mut self, entities: &[Document], ) -> Result<Vec<Document>, RepositoryError>; fn get(&self, id: &EntityId) -> Result<Option<Document>, RepositoryError>; fn get_multi( &self, ids: &[EntityId], ) -> Result<Vec<Option<Document>>, RepositoryError>; fn get_all(&self) -> Result<Vec<Document>, RepositoryError>; fn update(&mut self, entity: &Document) -> Result<Document, RepositoryError>; fn update_multi( &mut self, entities: &[Document], ) -> Result<Vec<Document>, RepositoryError>; fn update_with_relationships( &mut self, entity: &Document, ) -> Result<Document, RepositoryError>; fn update_with_relationships_multi( &mut self, entities: &[Document], ) -> Result<Vec<Document>, RepositoryError>; fn remove(&mut self, id: &EntityId) -> Result<(), RepositoryError>; fn remove_multi(&mut self, ids: &[EntityId]) -> Result<(), RepositoryError>; fn get_relationship( &self, id: &EntityId, field: &DocumentRelationshipField, ) -> Result<Vec<EntityId>, RepositoryError>; fn get_relationship_many( &self, ids: &[EntityId], field: &DocumentRelationshipField, ) -> Result<HashMap<EntityId, Vec<EntityId>>, RepositoryError>; fn get_relationship_count( &self, id: &EntityId, field: &DocumentRelationshipField, ) -> Result<usize, RepositoryError>; fn get_relationship_in_range( &self, id: &EntityId, field: &DocumentRelationshipField, offset: usize, limit: usize, ) -> Result<Vec<EntityId>, RepositoryError>; fn get_relationships_from_right_ids( &self, field: &DocumentRelationshipField, right_ids: &[EntityId], ) -> Result<Vec<(EntityId, Vec<EntityId>)>, RepositoryError>; fn set_relationship_multi( &mut self, field: &DocumentRelationshipField, relationships: Vec<(EntityId, Vec<EntityId>)>, ) -> Result<(), RepositoryError>; fn set_relationship( &mut self, id: &EntityId, field: &DocumentRelationshipField, right_ids: &[EntityId], ) -> Result<(), RepositoryError>; fn move_relationship_ids( &mut self, id: &EntityId, field: &DocumentRelationshipField, ids_to_move: &[EntityId], new_index: i32, ) -> Result<Vec<EntityId>, RepositoryError>; fn snapshot_rows( &self, ids: &[EntityId], ) -> Result<TableLevelSnapshot, RepositoryError>; fn restore_rows( &mut self, snap: &TableLevelSnapshot, ) -> Result<(), RepositoryError>;
}

Required Methods§

Source

fn create(&mut self, entity: &Document) -> Result<Document, RepositoryError>

Source

fn create_multi( &mut self, entities: &[Document], ) -> Result<Vec<Document>, RepositoryError>

Source

fn get(&self, id: &EntityId) -> Result<Option<Document>, RepositoryError>

Source

fn get_multi( &self, ids: &[EntityId], ) -> Result<Vec<Option<Document>>, RepositoryError>

Source

fn get_all(&self) -> Result<Vec<Document>, RepositoryError>

Source

fn update(&mut self, entity: &Document) -> Result<Document, RepositoryError>

Source

fn update_multi( &mut self, entities: &[Document], ) -> Result<Vec<Document>, RepositoryError>

Source

fn update_with_relationships( &mut self, entity: &Document, ) -> Result<Document, RepositoryError>

Source

fn update_with_relationships_multi( &mut self, entities: &[Document], ) -> Result<Vec<Document>, RepositoryError>

Source

fn remove(&mut self, id: &EntityId) -> Result<(), RepositoryError>

Source

fn remove_multi(&mut self, ids: &[EntityId]) -> Result<(), RepositoryError>

Source

fn get_relationship( &self, id: &EntityId, field: &DocumentRelationshipField, ) -> Result<Vec<EntityId>, RepositoryError>

Source

fn get_relationship_many( &self, ids: &[EntityId], field: &DocumentRelationshipField, ) -> Result<HashMap<EntityId, Vec<EntityId>>, RepositoryError>

Source

fn get_relationship_count( &self, id: &EntityId, field: &DocumentRelationshipField, ) -> Result<usize, RepositoryError>

Source

fn get_relationship_in_range( &self, id: &EntityId, field: &DocumentRelationshipField, offset: usize, limit: usize, ) -> Result<Vec<EntityId>, RepositoryError>

Source

fn get_relationships_from_right_ids( &self, field: &DocumentRelationshipField, right_ids: &[EntityId], ) -> Result<Vec<(EntityId, Vec<EntityId>)>, RepositoryError>

Source

fn set_relationship_multi( &mut self, field: &DocumentRelationshipField, relationships: Vec<(EntityId, Vec<EntityId>)>, ) -> Result<(), RepositoryError>

Source

fn set_relationship( &mut self, id: &EntityId, field: &DocumentRelationshipField, right_ids: &[EntityId], ) -> Result<(), RepositoryError>

Source

fn move_relationship_ids( &mut self, id: &EntityId, field: &DocumentRelationshipField, ids_to_move: &[EntityId], new_index: i32, ) -> Result<Vec<EntityId>, RepositoryError>

Source

fn snapshot_rows( &self, ids: &[EntityId], ) -> Result<TableLevelSnapshot, RepositoryError>

Source

fn restore_rows( &mut self, snap: &TableLevelSnapshot, ) -> Result<(), RepositoryError>

Implementors§