Skip to main content

DiaryStore

Trait DiaryStore 

Source
pub trait DiaryStore: Send + Sync {
    // Required methods
    fn append<'life0, 'async_trait>(
        &'life0 self,
        entry: DiaryEntry,
    ) -> Pin<Box<dyn Future<Output = Result<DiaryEntryId>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn recent<'life0, 'life1, 'async_trait>(
        &'life0 self,
        project: &'life1 str,
        limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<DiaryEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn all<'life0, 'life1, 'async_trait>(
        &'life0 self,
        project: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<DiaryEntry>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn count<'life0, 'life1, 'async_trait>(
        &'life0 self,
        project: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Asynchronous diary store.

Required Methods§

Source

fn append<'life0, 'async_trait>( &'life0 self, entry: DiaryEntry, ) -> Pin<Box<dyn Future<Output = Result<DiaryEntryId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Append a new entry.

Source

fn recent<'life0, 'life1, 'async_trait>( &'life0 self, project: &'life1 str, limit: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<DiaryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List the most recent entries for a project (newest first).

Source

fn all<'life0, 'life1, 'async_trait>( &'life0 self, project: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<DiaryEntry>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List every entry for a project (newest first).

Source

fn count<'life0, 'life1, 'async_trait>( &'life0 self, project: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Count entries for a project.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§