pub trait ExternalSave: Debug + Send + Sync {
    // Required methods
    fn save_read_filter<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        read_filter: &'life1 dyn ReadFilter
    ) -> Pin<Box<dyn Future<Output = Result<(), ExternalSaveError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_entry_to_msg_map<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        map: &'life1 HashMap<EntryId, MessageId>
    ) -> Pin<Box<dyn Future<Output = Result<(), ExternalSaveError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

This trait represent some kind of external save destination. A way to preserve the state of a read filter, i.e. what has and has not been read, across restarts.

Required Methods§

source

fn save_read_filter<'life0, 'life1, 'async_trait>( &'life0 mut self, read_filter: &'life1 dyn ReadFilter ) -> Pin<Box<dyn Future<Output = Result<(), ExternalSaveError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

This function will be called every time something has been marked as read and should be saved externally

Errors

It may return an error if there has been issues saving, e.g. writing to disk

source

fn save_entry_to_msg_map<'life0, 'life1, 'async_trait>( &'life0 mut self, map: &'life1 HashMap<EntryId, MessageId> ) -> Pin<Box<dyn Future<Output = Result<(), ExternalSaveError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save the entry id to message id map (see [Task.entry_to_msg_map]) enternally

Implementors§