pub trait MessageStore: StorageBackend {
Show 13 methods
// Required methods
fn create_thread<'life0, 'async_trait>(
&'life0 self,
thread: Thread,
) -> Pin<Box<dyn Future<Output = Result<ThreadId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<Option<Thread>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_thread<'life0, 'async_trait>(
&'life0 self,
thread: Thread,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_threads<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 UserId,
limit: usize,
offset: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Thread>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn create_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<MessageId>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 MessageId,
) -> Pin<Box<dyn Future<Output = Result<Option<Message>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 MessageId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
include_deleted: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_messages_by_execution<'life0, 'life1, 'async_trait>(
&'life0 self,
execution_id: &'life1 ExecutionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn get_or_create_thread<'life0, 'async_trait>(
&'life0 self,
tenant_id: TenantId,
user_id: UserId,
) -> Pin<Box<dyn Future<Output = Result<Thread>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn count_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
MessageStore trait - thread/message persistence
This is the core persistence trait for user-facing message storage. Unlike EventStore (immutable audit log), MessageStore supports:
- Soft delete (GDPR compliance)
- Message editing (optional)
- Thread management
Required Methods§
Sourcefn create_thread<'life0, 'async_trait>(
&'life0 self,
thread: Thread,
) -> Pin<Box<dyn Future<Output = Result<ThreadId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_thread<'life0, 'async_trait>(
&'life0 self,
thread: Thread,
) -> Pin<Box<dyn Future<Output = Result<ThreadId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new thread
Sourcefn get_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<Option<Thread>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<Option<Thread>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a thread by ID
Sourcefn update_thread<'life0, 'async_trait>(
&'life0 self,
thread: Thread,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_thread<'life0, 'async_trait>(
&'life0 self,
thread: Thread,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update thread (title, etc.)
Sourcefn delete_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Soft-delete a thread (sets deleted_at)
Sourcefn list_threads<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 UserId,
limit: usize,
offset: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Thread>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list_threads<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tenant_id: &'life1 TenantId,
user_id: &'life2 UserId,
limit: usize,
offset: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Thread>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
List threads for a user
Sourcefn create_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<MessageId>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new message in a thread
Sourcefn get_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 MessageId,
) -> Pin<Box<dyn Future<Output = Result<Option<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 MessageId,
) -> Pin<Box<dyn Future<Output = Result<Option<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a message by ID
Sourcefn update_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_message<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update a message (content, metadata)
Sourcefn delete_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 MessageId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message_id: &'life1 MessageId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Soft-delete a message
Sourcefn list_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
include_deleted: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 ThreadId,
include_deleted: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all messages in a thread (ordered by created_at)
Sourcefn get_messages_by_execution<'life0, 'life1, 'async_trait>(
&'life0 self,
execution_id: &'life1 ExecutionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_messages_by_execution<'life0, 'life1, 'async_trait>(
&'life0 self,
execution_id: &'life1 ExecutionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get messages by execution ID