pub struct ExternalMemory { /* private fields */ }Expand description
External memory manager for storing and retrieving session notes.
Implementations§
Source§impl ExternalMemory
impl ExternalMemory
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default settings.
Uses the Bamboo data directory’s session memory store.
pub fn store(&self) -> &MemoryStore
Sourcepub async fn save_topic(
&self,
session_id: &str,
topic: &str,
note: &str,
) -> Result<PathBuf>
pub async fn save_topic( &self, session_id: &str, topic: &str, note: &str, ) -> Result<PathBuf>
Save a note for a specific topic.
Sourcepub async fn read_topic(
&self,
session_id: &str,
topic: &str,
) -> Result<Option<String>>
pub async fn read_topic( &self, session_id: &str, topic: &str, ) -> Result<Option<String>>
Read a note for a specific topic.
Sourcepub async fn delete_topic(&self, session_id: &str, topic: &str) -> Result<bool>
pub async fn delete_topic(&self, session_id: &str, topic: &str) -> Result<bool>
Delete a note for a specific topic.
Sourcepub async fn append_topic(
&self,
session_id: &str,
topic: &str,
content: &str,
) -> Result<PathBuf>
pub async fn append_topic( &self, session_id: &str, topic: &str, content: &str, ) -> Result<PathBuf>
Append to an existing topic note, or create a new one.
Sourcepub async fn list_topics(&self, session_id: &str) -> Result<Vec<String>>
pub async fn list_topics(&self, session_id: &str) -> Result<Vec<String>>
List all topics for a session.
Sourcepub async fn save_note(&self, session_id: &str, note: &str) -> Result<PathBuf>
pub async fn save_note(&self, session_id: &str, note: &str) -> Result<PathBuf>
Save a note for a session (default topic).
Sourcepub async fn read_note(&self, session_id: &str) -> Result<Option<String>>
pub async fn read_note(&self, session_id: &str) -> Result<Option<String>>
Read a note for a session (default topic).
Sourcepub async fn delete_note(&self, session_id: &str) -> Result<bool>
pub async fn delete_note(&self, session_id: &str) -> Result<bool>
Delete a note for a session (default topic).
Sourcepub async fn append_note(
&self,
session_id: &str,
content: &str,
) -> Result<PathBuf>
pub async fn append_note( &self, session_id: &str, content: &str, ) -> Result<PathBuf>
Append to an existing note (default topic).
Sourcepub async fn list_sessions_with_notes(&self) -> Result<Vec<String>>
pub async fn list_sessions_with_notes(&self) -> Result<Vec<String>>
List all session IDs that have notes.
Sourcepub fn get_note_path(&self, session_id: &str) -> PathBuf
pub fn get_note_path(&self, session_id: &str) -> PathBuf
Get the path to the default notes file for a session.
Trait Implementations§
Source§impl Clone for ExternalMemory
impl Clone for ExternalMemory
Source§fn clone(&self) -> ExternalMemory
fn clone(&self) -> ExternalMemory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExternalMemory
impl RefUnwindSafe for ExternalMemory
impl Send for ExternalMemory
impl Sync for ExternalMemory
impl Unpin for ExternalMemory
impl UnsafeUnpin for ExternalMemory
impl UnwindSafe for ExternalMemory
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