Skip to main content

ConversationMessageStore

Trait ConversationMessageStore 

Source
pub trait ConversationMessageStore: Send + Sync {
    // Required methods
    fn append_message<'life0, 'async_trait>(
        &'life0 self,
        message: StoredMessage,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_messages<'life0, 'async_trait>(
        &'life0 self,
        conversation_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<StoredMessage>, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Appends and reads ordered conversation messages.

Appends must be contiguous and start at sequence zero. Each message is immutable once stored; corrections should be represented by a new message.

Required Methods§

Source

fn append_message<'life0, 'async_trait>( &'life0 self, message: StoredMessage, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn list_messages<'life0, 'async_trait>( &'life0 self, conversation_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Vec<StoredMessage>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§