ThreadReader

Trait ThreadReader 

Source
pub trait ThreadReader: Send + Sync {
    // Required methods
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ThreadHead>, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_threads<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 ThreadListQuery,
    ) -> Pin<Box<dyn Future<Output = Result<ThreadListPage, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn load_thread<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Thread>, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn load_messages<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
        query: &'life2 MessageQuery,
    ) -> Pin<Box<dyn Future<Output = Result<MessagePage, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn list_paginated<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 ThreadListQuery,
    ) -> Pin<Box<dyn Future<Output = Result<ThreadListPage, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn message_count<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<usize, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn load_run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _run_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn list_runs<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _query: &'life1 RunQuery,
    ) -> Pin<Box<dyn Future<Output = Result<RunPage, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn active_run_for_thread<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>, ThreadStoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

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

Load an Thread and its current version.

Source

fn list_threads<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 ThreadListQuery, ) -> Pin<Box<dyn Future<Output = Result<ThreadListPage, ThreadStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List Thread ids.

Provided Methods§

Source

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

Load an Thread without version info. Convenience wrapper.

Source

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

Load paginated messages for an Thread.

Source

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

List all Thread ids with default paging.

Source

fn list_paginated<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 ThreadListQuery, ) -> Pin<Box<dyn Future<Output = Result<ThreadListPage, ThreadStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List Thread ids with explicit query.

Source

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

Return total message count.

Source

fn load_run<'life0, 'life1, 'async_trait>( &'life0 self, _run_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>, ThreadStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load one run record by run id.

Source

fn list_runs<'life0, 'life1, 'async_trait>( &'life0 self, _query: &'life1 RunQuery, ) -> Pin<Box<dyn Future<Output = Result<RunPage, ThreadStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List runs with optional filtering and pagination.

Source

fn active_run_for_thread<'life0, 'life1, 'async_trait>( &'life0 self, _thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>, ThreadStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load the most recent non-terminal run for a thread, if any.

Implementors§