Trait SessionStore

Source
pub trait SessionStore: Send + Sync {
Show 14 methods // Required methods fn create_session<'life0, 'async_trait>( &'life0 self, config: SessionConfig, ) -> Pin<Box<dyn Future<Output = Result<Session, SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_session<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 Session, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_sessions<'life0, 'async_trait>( &'life0 self, filter: SessionFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionInfo>, SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn append_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, message: &'life2 Message, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_messages<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, after_sequence: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn create_tool_call<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, tool_call: &'life2 ToolCall, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn update_tool_call<'life0, 'life1, 'async_trait>( &'life0 self, tool_call_id: &'life1 str, update: ToolCallUpdate, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_pending_tool_calls<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<ToolCall>, SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn append_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, event: &'life2 StreamEvent, ) -> Pin<Box<dyn Future<Output = Result<u64, SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_events<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, after_sequence: u64, limit: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, StreamEvent)>, SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_events_before<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, before_sequence: u64, ) -> Pin<Box<dyn Future<Output = Result<u64, SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_active_message_id<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, message_id: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait;
}
Expand description

Database-agnostic session store trait

Required Methods§

Source

fn create_session<'life0, 'async_trait>( &'life0 self, config: SessionConfig, ) -> Pin<Box<dyn Future<Output = Result<Session, SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_session<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_session<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 Session, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

fn list_sessions<'life0, 'async_trait>( &'life0 self, filter: SessionFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<SessionInfo>, SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

fn get_messages<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, after_sequence: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn create_tool_call<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, tool_call: &'life2 ToolCall, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn update_tool_call<'life0, 'life1, 'async_trait>( &'life0 self, tool_call_id: &'life1 str, update: ToolCallUpdate, ) -> Pin<Box<dyn Future<Output = Result<(), SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_pending_tool_calls<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<ToolCall>, SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn append_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session_id: &'life1 str, event: &'life2 StreamEvent, ) -> Pin<Box<dyn Future<Output = Result<u64, SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_events<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, after_sequence: u64, limit: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, StreamEvent)>, SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete_events_before<'life0, 'life1, 'async_trait>( &'life0 self, session_id: &'life1 str, before_sequence: u64, ) -> Pin<Box<dyn Future<Output = Result<u64, SessionStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Implementors§