pub struct InMemoryStore { /* private fields */ }Expand description
In-memory storage implementing all four store traits.
Uses tokio::sync::RwLock for async-safe concurrent access.
Data lives only in memory and is lost when the store is dropped.
Implementations§
Source§impl InMemoryStore
impl InMemoryStore
Sourcepub fn new() -> InMemoryStore
pub fn new() -> InMemoryStore
Create a new empty in-memory store.
Trait Implementations§
Source§impl ConfigChangeNotifier for InMemoryStore
impl ConfigChangeNotifier for InMemoryStore
fn subscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ConfigChangeSubscriber>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryStore: 'async_trait,
Source§impl ConfigStore for InMemoryStore
impl ConfigStore for InMemoryStore
Source§fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Value>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
offset: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Value)>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
offset: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, Value)>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn put_if_absent<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
fn put_if_absent<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
value: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn put_if_revision<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
value: &'life3 Value,
expected_revision: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
fn put_if_revision<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
value: &'life3 Value,
expected_revision: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
meta.revision. Read moreSource§fn delete_if_revision<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
expected_revision: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn delete_if_revision<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
expected_revision: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§impl Debug for InMemoryStore
impl Debug for InMemoryStore
Source§impl Default for InMemoryStore
impl Default for InMemoryStore
Source§fn default() -> InMemoryStore
fn default() -> InMemoryStore
Source§impl PendingMessageStore for InMemoryStore
impl PendingMessageStore for InMemoryStore
fn load_pending_message_records<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingMessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn list_threads_with_pending_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: usize,
after: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn list_threads_with_pending_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
limit: usize,
after: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
limit thread ids (ascending; limit == 0 means unbounded)
that currently hold at least one pending message, strictly greater than
after (the previous page’s last id) for cursor pagination. Startup
recovery pages through this to detect threads whose consume opportunity
may have been lost — pending was persisted but the dispatch/notification
did not survive — without scanning the whole table at once (ADR-0042 D7).fn append_pending_message_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
delivery_mode: DeliveryMode,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingMessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn update_pending_message_record_checked<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
pending_id: &'life2 str,
expected_revision: Option<u64>,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<PendingMessageRecord, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn retract_pending_message_record_checked<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
pending_id: &'life2 str,
expected_revision: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<PendingMessageRecord, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn reorder_pending_message_records_checked<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
expected_queue_revision: Option<u64>,
ordered_pending_ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingMessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn freeze_pending_message_records<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
boundary: DeliveryBoundary,
expected_message_version: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn freeze_pending_message_records_with_run<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
boundary: DeliveryBoundary,
expected_message_version: Option<u64>,
expected_pending_ids: &'life2 [String],
run: &'life3 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn append_and_freeze_pending_message_records_with_run<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
new_messages: &'life2 [Message],
append_delivery_mode: DeliveryMode,
boundary: DeliveryBoundary,
expected_message_version: Option<u64>,
expected_pending_ids: &'life3 [String],
run: &'life4 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
InMemoryStore: 'async_trait,
fn append_and_freeze_pending_message_records_with_run<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
new_messages: &'life2 [Message],
append_delivery_mode: DeliveryMode,
boundary: DeliveryBoundary,
expected_message_version: Option<u64>,
expected_pending_ids: &'life3 [String],
run: &'life4 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
InMemoryStore: 'async_trait,
new_messages to pending and freeze the selected
pending entries (existing + newly appended) with the run record, in one
backend boundary (ADR-0042 D7). Read morefn update_pending_message_record<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
pending_id: &'life2 str,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<PendingMessageRecord, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn retract_pending_message_record<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
pending_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<PendingMessageRecord, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn reorder_pending_message_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
ordered_pending_ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingMessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§impl ProfileStore for InMemoryStore
impl ProfileStore for InMemoryStore
Source§fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ProfileEntry>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn get<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ProfileEntry>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
None if not set.Source§fn set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
key: &'life2 str,
value: Value,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
key: &'life2 str,
value: Value,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
updated_at.Source§fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProfileEntry>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
) -> Pin<Box<dyn Future<Output = Result<Vec<ProfileEntry>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn clear_owner<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn clear_owner<'life0, 'life1, 'async_trait>(
&'life0 self,
owner: &'life1 ProfileOwner,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§impl RunStore for InMemoryStore
impl RunStore for InMemoryStore
Source§fn create_run<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn create_run<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn load_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn load_run<'life0, 'life1, 'async_trait>(
&'life0 self,
run_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
run_id.Source§fn latest_run<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn latest_run<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<RunRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
updated_at).Source§fn list_runs<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 RunQuery,
) -> Pin<Box<dyn Future<Output = Result<RunPage, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn list_runs<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 RunQuery,
) -> Pin<Box<dyn Future<Output = Result<RunPage, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§impl ThreadRunStore for InMemoryStore
impl ThreadRunStore for InMemoryStore
Source§fn checkpoint_append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
expected_version: Option<u64>,
run: &'life3 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
fn checkpoint_append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
expected_version: Option<u64>,
run: &'life3 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
Atomic, version-guarded committed append: holds the thread/message/run
write locks across the read-check-append-write so concurrent writers
(including separate Mailbox instances sharing this store) never lose
an append (ADR-0042 D5). A stale expected_version leaves all state
untouched.
Source§fn thread_run_storage_identity(&self) -> Option<String>
fn thread_run_storage_identity(&self) -> Option<String>
Source§fn checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
run: &'life3 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
fn checkpoint<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
run: &'life3 RunRecord,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
InMemoryStore: 'async_trait,
use CommitCoordinator (ADR-0038 D7)
Source§fn load_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointSnapshot>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn load_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointSnapshot>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
CheckpointSnapshot for resume (ADR-0038 C5). Read moreSource§impl ThreadStore for InMemoryStore
impl ThreadStore for InMemoryStore
Source§fn append_message_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn append_message_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
Atomic append: holds the messages write lock across the whole
read-modify-write, so concurrent writers (including separate Mailbox
instances sharing this store) never lose an append. Overrides the
non-atomic default load → extend → save (ADR-0042 D4/D5).
Source§fn load_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Thread>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn load_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Thread>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
None if not found.Source§fn save_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread: &'life1 Thread,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn save_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread: &'life1 Thread,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn save_thread_validated<'life0, 'life1, 'async_trait>(
&'life0 self,
thread: &'life1 Thread,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn save_thread_validated<'life0, 'life1, 'async_trait>(
&'life0 self,
thread: &'life1 Thread,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn delete_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn delete_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn save_thread_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
state: &'life2 PersistedState,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn save_thread_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
state: &'life2 PersistedState,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
thread_id (overwrite the prior value). Read moreSource§fn load_thread_state<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PersistedState>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn load_thread_state<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PersistedState>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
thread_id, if any. Default None.Source§fn delete_thread_with_strategy<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
strategy: ChildThreadDeleteStrategy,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn delete_thread_with_strategy<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
strategy: ChildThreadDeleteStrategy,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn list_threads<'life0, 'async_trait>(
&'life0 self,
offset: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryStore: 'async_trait,
fn list_threads<'life0, 'async_trait>(
&'life0 self,
offset: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn list_threads_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 ThreadQuery,
) -> Pin<Box<dyn Future<Output = Result<ThreadPage, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn list_threads_query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 ThreadQuery,
) -> Pin<Box<dyn Future<Output = Result<ThreadPage, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn load_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Message>>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn load_committed_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<Message>>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn list_message_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
query: &'life2 MessageQuery,
) -> Pin<Box<dyn Future<Output = Result<MessagePage, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn list_message_records<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
query: &'life2 MessageQuery,
) -> Pin<Box<dyn Future<Output = Result<MessagePage, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn save_messages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
fn save_messages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
messages: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
InMemoryStore: 'async_trait,
Source§fn delete_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn delete_messages<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
NotFound if the thread does not exist.Source§fn update_thread_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
metadata: ThreadMetadata,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
fn update_thread_metadata<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
metadata: ThreadMetadata,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
InMemoryStore: 'async_trait,
NotFound if the thread does not exist.Source§fn list_child_threads<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Thread>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn list_child_threads<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Thread>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn validate_thread_hierarchy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
parent_thread_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn validate_thread_hierarchy<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
parent_thread_id: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn load_message_records<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<MessageRecord>>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn load_message_record<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn load_message_record<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
message_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn load_message_records_range<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
range: MessageSeqRange,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn load_message_records_range<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
range: MessageSeqRange,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageRecord>, StorageError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl !Freeze for InMemoryStore
impl !RefUnwindSafe for InMemoryStore
impl !UnwindSafe for InMemoryStore
impl Send for InMemoryStore
impl Sync for InMemoryStore
impl Unpin for InMemoryStore
impl UnsafeUnpin for InMemoryStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more