pub struct SummaryMemory { /* private fields */ }Expand description
Single-string summary keyed by Namespace.
Implementations§
Source§impl SummaryMemory
impl SummaryMemory
Sourcepub fn new(store: Arc<dyn Store<String>>, namespace: Namespace) -> Self
pub fn new(store: Arc<dyn Store<String>>, namespace: Namespace) -> Self
Build a summary memory over store scoped to namespace.
Sourcepub async fn set(
&self,
ctx: &ExecutionContext,
summary: impl Into<String>,
) -> Result<()>
pub async fn set( &self, ctx: &ExecutionContext, summary: impl Into<String>, ) -> Result<()>
Replace the current summary.
Sourcepub async fn append(&self, ctx: &ExecutionContext, addition: &str) -> Result<()>
pub async fn append(&self, ctx: &ExecutionContext, addition: &str) -> Result<()>
Append addition to the existing summary, separated by a blank
line. If no summary exists, addition becomes the summary.
Sourcepub async fn get(&self, ctx: &ExecutionContext) -> Result<Option<String>>
pub async fn get(&self, ctx: &ExecutionContext) -> Result<Option<String>>
Read the current summary.
Sourcepub async fn clear(&self, ctx: &ExecutionContext) -> Result<()>
pub async fn clear(&self, ctx: &ExecutionContext) -> Result<()>
Delete the summary.
Auto Trait Implementations§
impl Freeze for SummaryMemory
impl !RefUnwindSafe for SummaryMemory
impl Send for SummaryMemory
impl Sync for SummaryMemory
impl Unpin for SummaryMemory
impl UnsafeUnpin for SummaryMemory
impl !UnwindSafe for SummaryMemory
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