Skip to main content

ConversationPersistence

Trait ConversationPersistence 

Source
pub trait ConversationPersistence: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        conversation: &'life1 Conversation,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ConversationId,
    ) -> Pin<Box<dyn Future<Output = Result<Conversation>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ConversationId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_ids<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ConversationId>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ConversationId,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_summaries<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ConversationSummary>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for conversation persistence operations

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, conversation: &'life1 Conversation, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a conversation to storage

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ConversationId, ) -> Pin<Box<dyn Future<Output = Result<Conversation>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load a conversation by ID

Source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ConversationId, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a conversation by ID

Source

fn list_ids<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ConversationId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all conversation IDs

Source

fn exists<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ConversationId, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a conversation exists

Source

fn list_summaries<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ConversationSummary>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List conversations with summaries

Implementors§