pub struct MemoryStore {
pub dir: PathBuf,
pub meta: MemoryMeta,
/* private fields */
}Fields§
§dir: PathBuf§meta: MemoryMetaImplementations§
Source§impl MemoryStore
impl MemoryStore
pub fn open( home: &Path, id: &str, created_at: &str, ) -> Result<Self, MemoryError>
pub fn existing(home: &Path, id: &str) -> Result<Self, MemoryError>
pub fn snapshot(home: &Path, id: &str) -> Result<SourceMemory, MemoryError>
pub fn read_meta(&self) -> Result<MemoryMeta, MemoryError>
pub fn lock(&self) -> Result<LockGuard, MemoryError>
pub fn write_meta( &self, guard: &LockGuard, meta: &MemoryMeta, ) -> Result<(), MemoryError>
Source§impl MemoryStore
impl MemoryStore
pub fn load(&self) -> Result<SourceMemory, MemoryError>
pub fn recover(&self, guard: &LockGuard) -> Result<(), MemoryError>
pub async fn capture( &self, user: &str, assistant: &str, options: CaptureOptions<'_>, cancel: &CancellationToken, ) -> Result<CaptureResult, MemoryError>
Source§impl MemoryStore
impl MemoryStore
pub async fn migrate( &self, target_id: &str, created_at: &str, options: MigrationOptions<'_>, move_source: bool, cancel: &CancellationToken, ) -> Result<MemoryStore, MemoryError>
pub async fn prepare_migration( &self, target_id: &str, options: MigrationOptions<'_>, cancel: &CancellationToken, ) -> Result<PreparedMigration, MemoryError>
pub fn commit_migration( &self, prepared: PreparedMigration, created_at: &str, move_source: bool, cancel: &CancellationToken, ) -> Result<MemoryStore, MemoryError>
pub fn commit_migration_with( &self, prepared: PreparedMigration, created_at: &str, move_source: bool, cancel: &CancellationToken, check: impl FnOnce() -> Result<(), MemoryError>, ) -> Result<MemoryStore, MemoryError>
Trait Implementations§
Source§impl Clone for MemoryStore
impl Clone for MemoryStore
Auto Trait Implementations§
impl Forget for MemoryStore
impl Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
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