pub trait DataProvider {
// Required methods
async fn load_all_entries(&mut self) -> Result<Vec<Entry>>;
async fn add_entry(
&mut self,
entry: EntryDraft,
) -> Result<Entry, ModifyEntryError>;
async fn restore_entry(
&mut self,
entry: Entry,
) -> Result<Entry, ModifyEntryError>;
async fn remove_entry(&mut self, entry_id: u32) -> Result<()>;
async fn update_entry(
&mut self,
entry: Entry,
) -> Result<Entry, ModifyEntryError>;
async fn get_export_object(
&mut self,
entries_ids: &[u32],
) -> Result<EntriesDTO>;
async fn assign_priority_to_entries(&mut self, priority: u32) -> Result<()>;
// Provided method
async fn import_entries(&mut self, entries_dto: EntriesDTO) -> Result<()> { ... }
}Required Methods§
async fn load_all_entries(&mut self) -> Result<Vec<Entry>>
async fn add_entry( &mut self, entry: EntryDraft, ) -> Result<Entry, ModifyEntryError>
Sourceasync fn restore_entry(
&mut self,
entry: Entry,
) -> Result<Entry, ModifyEntryError>
async fn restore_entry( &mut self, entry: Entry, ) -> Result<Entry, ModifyEntryError>
Restores an entry with its existing id. Implementations must not overwrite another entry.
async fn remove_entry(&mut self, entry_id: u32) -> Result<()>
async fn update_entry( &mut self, entry: Entry, ) -> Result<Entry, ModifyEntryError>
async fn get_export_object(&mut self, entries_ids: &[u32]) -> Result<EntriesDTO>
Sourceasync fn assign_priority_to_entries(&mut self, priority: u32) -> Result<()>
async fn assign_priority_to_entries(&mut self, priority: u32) -> Result<()>
Assigns priority to all entries that don’t have a priority assigned to
Provided Methods§
async fn import_entries(&mut self, entries_dto: EntriesDTO) -> Result<()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".