pub struct InMemoryMessageStore { /* private fields */ }Expand description
In-memory implementation of MessageStore
Thread-safe storage using RwLock. Suitable for single-node deployments and testing. For persistence across restarts, use SQLite implementation.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryMessageStore
impl Default for InMemoryMessageStore
Source§fn default() -> InMemoryMessageStore
fn default() -> InMemoryMessageStore
Returns the “default value” for a type. Read more
Source§impl MessageStore for InMemoryMessageStore
impl MessageStore for InMemoryMessageStore
Source§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 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
Source§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 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
Source§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 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.)
Source§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 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)
Source§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 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
Source§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 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
Source§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 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
Source§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 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)
Source§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 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
Source§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 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)
Source§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,
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
Source§impl StorageBackend for InMemoryMessageStore
impl StorageBackend for InMemoryMessageStore
Source§fn name(&self) -> &str
fn name(&self) -> &str
Human-readable name of this backend (e.g., “sqlite”, “postgres”, “qdrant”)
Source§fn requires_network(&self) -> bool
fn requires_network(&self) -> bool
Does this backend require network access? Read more
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Health check - verify the backend is operational Read more
Source§fn supports_air_gapped(&self) -> bool
fn supports_air_gapped(&self) -> bool
Can this backend operate in air-gapped mode? Read more
Auto Trait Implementations§
impl !Freeze for InMemoryMessageStore
impl RefUnwindSafe for InMemoryMessageStore
impl Send for InMemoryMessageStore
impl Sync for InMemoryMessageStore
impl Unpin for InMemoryMessageStore
impl UnsafeUnpin for InMemoryMessageStore
impl UnwindSafe for InMemoryMessageStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more