pub struct InMemoryMessageRetriever { /* private fields */ }Expand description
In-memory message retriever
Stores messages in a HashMap keyed by session ID.
Implements the MessageRetriever trait for retrieval operations.
Note: Write operations (add, store) are provided as inherent methods for testing purposes. In production, messages are stored via EventEmitter.
Implementations§
Source§impl InMemoryMessageRetriever
impl InMemoryMessageRetriever
Sourcepub async fn clear_session(&self, session_id: SessionId)
pub async fn clear_session(&self, session_id: SessionId)
Clear messages for a specific session
Sourcepub async fn seed(&self, session_id: SessionId, messages: Vec<Message>)
pub async fn seed(&self, session_id: SessionId, messages: Vec<Message>)
Pre-populate with messages (useful for testing)
Trait Implementations§
Source§impl Clone for InMemoryMessageRetriever
impl Clone for InMemoryMessageRetriever
Source§fn clone(&self) -> InMemoryMessageRetriever
fn clone(&self) -> InMemoryMessageRetriever
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryMessageRetriever
impl Debug for InMemoryMessageRetriever
Source§impl Default for InMemoryMessageRetriever
impl Default for InMemoryMessageRetriever
Source§fn default() -> InMemoryMessageRetriever
fn default() -> InMemoryMessageRetriever
Returns the “default value” for a type. Read more
Source§impl MessageRetriever for InMemoryMessageRetriever
impl MessageRetriever for InMemoryMessageRetriever
Source§fn get<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
message_id: MessageId,
) -> Pin<Box<dyn Future<Output = Result<Option<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
message_id: MessageId,
) -> Pin<Box<dyn Future<Output = Result<Option<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a specific message by ID
Source§fn load<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load all messages for a session
Source§fn load_filtered<'life0, 'async_trait>(
&'life0 self,
query: MessageQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_filtered<'life0, 'async_trait>(
&'life0 self,
query: MessageQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load messages with filters and injections applied. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryMessageRetriever
impl !UnwindSafe for InMemoryMessageRetriever
impl Freeze for InMemoryMessageRetriever
impl Send for InMemoryMessageRetriever
impl Sync for InMemoryMessageRetriever
impl Unpin for InMemoryMessageRetriever
impl UnsafeUnpin for InMemoryMessageRetriever
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request