Skip to main content

ThreadStore

Trait ThreadStore 

Source
pub trait ThreadStore: Send + Sync {
Show 18 methods // Required methods fn as_any(&self) -> &dyn Any; fn create_thread<'life0, 'async_trait>( &'life0 self, request: CreateThreadRequest, ) -> Pin<Box<dyn Future<Output = Result<Thread>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_thread<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> 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, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, request: UpdateThreadRequest, ) -> Pin<Box<dyn Future<Output = Result<Thread>> + 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 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_threads<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 ThreadListFilter, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<ThreadListResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_thread_with_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_home_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HomeStats>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_agents_by_usage<'life0, 'life1, 'async_trait>( &'life0 self, search: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentUsageInfo>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_agent_stats_map<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, AgentStatsInfo>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn mark_message_read<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<MessageReadStatus>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_message_read_status<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<MessageReadStatus>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_thread_read_status<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<MessageReadStatus>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn vote_message<'life0, 'async_trait>( &'life0 self, request: VoteMessageRequest, ) -> Pin<Box<dyn Future<Output = Result<MessageVote>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn remove_vote<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_user_vote<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<MessageVote>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_message_vote_summary<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<MessageVoteSummary>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_message_votes<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<MessageVote>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait;
}

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn create_thread<'life0, 'async_trait>( &'life0 self, request: CreateThreadRequest, ) -> Pin<Box<dyn Future<Output = Result<Thread>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_thread<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Thread>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_thread<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, request: UpdateThreadRequest, ) -> Pin<Box<dyn Future<Output = Result<Thread>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn list_threads<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 ThreadListFilter, limit: Option<u32>, offset: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<ThreadListResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List threads with pagination and filtering Returns a paginated response with total count

Source

fn update_thread_with_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

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

Get aggregated home statistics

Source

fn get_agents_by_usage<'life0, 'life1, 'async_trait>( &'life0 self, search: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentUsageInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get agents sorted by thread count (most active first) Includes all registered agents (even those with 0 threads). Optionally filters by name using a search string.

Source

fn get_agent_stats_map<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, AgentStatsInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a map of agent name -> stats for all agents with activity

Source

fn mark_message_read<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<MessageReadStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Mark a message as read by the current user

Source

fn get_message_read_status<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<MessageReadStatus>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get read status for a specific message

Source

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

Get read status for all messages in a thread for the current user

Source

fn vote_message<'life0, 'async_trait>( &'life0 self, request: VoteMessageRequest, ) -> Pin<Box<dyn Future<Output = Result<MessageVote>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Vote on a message (upvote or downvote) For downvotes, a comment is required

Source

fn remove_vote<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove a vote from a message

Source

fn get_user_vote<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<MessageVote>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get the current user’s vote on a message

Source

fn get_message_vote_summary<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<MessageVoteSummary>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get vote summary for a message (counts + current user’s vote)

Source

fn get_message_votes<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, message_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<MessageVote>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get all votes for a message (admin/analytics use)

Implementors§