Trait DataProvider

Source
pub trait DataProvider {
    // Required methods
    async fn load_all_entries(&self) -> Result<Vec<Entry>>;
    async fn add_entry(
        &self,
        entry: EntryDraft,
    ) -> Result<Entry, ModifyEntryError>;
    async fn remove_entry(&self, entry_id: u32) -> Result<()>;
    async fn update_entry(
        &self,
        entry: Entry,
    ) -> Result<Entry, ModifyEntryError>;
    async fn get_export_object(&self, entries_ids: &[u32]) -> Result<EntriesDTO>;
    async fn assign_priority_to_entries(&self, priority: u32) -> Result<()>;

    // Provided method
    async fn import_entries(&self, entries_dto: EntriesDTO) -> Result<()> { ... }
}

Required Methods§

Source

async fn load_all_entries(&self) -> Result<Vec<Entry>>

Source

async fn add_entry(&self, entry: EntryDraft) -> Result<Entry, ModifyEntryError>

Source

async fn remove_entry(&self, entry_id: u32) -> Result<()>

Source

async fn update_entry(&self, entry: Entry) -> Result<Entry, ModifyEntryError>

Source

async fn get_export_object(&self, entries_ids: &[u32]) -> Result<EntriesDTO>

Source

async fn assign_priority_to_entries(&self, priority: u32) -> Result<()>

Assigns priority to all entries that don’t have a priority assigned to

Provided Methods§

Source

async fn import_entries(&self, entries_dto: EntriesDTO) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§