pub struct FileChatMessageHistory { /* private fields */ }Expand description
A chat message history backed by a JSON file on disk.
Messages are stored as a JSON array. Each session gets its own file by appending the session ID to the base path.
Implementations§
Trait Implementations§
Source§impl MemoryStore for FileChatMessageHistory
impl MemoryStore for FileChatMessageHistory
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn clear<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), SynapticError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for FileChatMessageHistory
impl RefUnwindSafe for FileChatMessageHistory
impl Send for FileChatMessageHistory
impl Sync for FileChatMessageHistory
impl Unpin for FileChatMessageHistory
impl UnsafeUnpin for FileChatMessageHistory
impl UnwindSafe for FileChatMessageHistory
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