pub struct PostgresMessageStore { /* private fields */ }Implementations§
Trait Implementations§
Source§impl MessageStore for PostgresMessageStore
impl MessageStore for PostgresMessageStore
Source§fn save_messages<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
messages: &'life2 [ChatMessage],
scope: &'life3 Scope,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageId>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn save_messages<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
messages: &'life2 [ChatMessage],
scope: &'life3 Scope,
) -> Pin<Box<dyn Future<Output = Result<Vec<MessageId>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Save one or more messages to a conversation. Returns the ids of the
saved messages.
Source§fn get_messages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
last_n: Option<usize>,
scope: &'life2 Scope,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChatMessage>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_messages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
last_n: Option<usize>,
scope: &'life2 Scope,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChatMessage>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve messages from a conversation, optionally limited to the last N
messages. Results are ordered by
seq ascending.Source§fn list_conversations<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: &'life1 Scope,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_conversations<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: &'life1 Scope,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all conversation ids visible to the given scope.
Source§fn delete_messages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
scope: &'life2 Scope,
) -> Pin<Box<dyn Future<Output = Result<u64, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_messages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
conversation_id: &'life1 str,
scope: &'life2 Scope,
) -> Pin<Box<dyn Future<Output = Result<u64, MemoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete all messages in a conversation. Returns the number of rows deleted.
Auto Trait Implementations§
impl Freeze for PostgresMessageStore
impl !RefUnwindSafe for PostgresMessageStore
impl Send for PostgresMessageStore
impl Sync for PostgresMessageStore
impl Unpin for PostgresMessageStore
impl UnsafeUnpin for PostgresMessageStore
impl !UnwindSafe for PostgresMessageStore
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
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>
Converts
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>
Converts
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