Skip to main content

MetadataStorage

Trait MetadataStorage 

Source
pub trait MetadataStorage: Send + Sync {
    // Required methods
    fn add_history<'life0, 'life1, 'async_trait>(
        &'life0 self,
        item: &'life1 HistoryItem,
    ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_history<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
        limit: usize,
        offset: usize,
    ) -> Pin<Box<dyn Future<Output = WebResult<(Vec<HistoryItem>, i64)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_history<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        session_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn clear_history<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_favorite<'life0, 'life1, 'async_trait>(
        &'life0 self,
        item: &'life1 FavoriteItem,
    ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_favorites<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = WebResult<Vec<FavoriteItem>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_favorite<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        session_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = WebResult<FavoriteItem>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn update_favorite<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        session_id: &'life2 str,
        item: &'life3 FavoriteItem,
    ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn delete_favorite<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        session_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete_all_favorites<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Metadata storage trait

Required Methods§

Source

fn add_history<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 HistoryItem, ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a history item

Source

fn get_history<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, limit: usize, offset: usize, ) -> Pin<Box<dyn Future<Output = WebResult<(Vec<HistoryItem>, i64)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get history items for a session

Source

fn delete_history<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, session_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete a history item

Source

fn clear_history<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Clear all history for a session

Source

fn add_favorite<'life0, 'life1, 'async_trait>( &'life0 self, item: &'life1 FavoriteItem, ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a favorite item

Source

fn get_favorites<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = WebResult<Vec<FavoriteItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all favorites for a session

Source

fn get_favorite<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, session_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = WebResult<FavoriteItem>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get a favorite by ID

Source

fn update_favorite<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, id: &'life1 str, session_id: &'life2 str, item: &'life3 FavoriteItem, ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Update a favorite

Source

fn delete_favorite<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, session_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete a favorite

Source

fn delete_all_favorites<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = WebResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete all favorites for a session

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§