pub struct MemoryBinding { /* private fields */ }Implementations§
Source§impl MemoryBinding
impl MemoryBinding
pub async fn history_seal( &self, logical_id: &str, messages: &[SharedMessage], note: &str, ) -> Result<(ArchiveRef, String)>
Sourcepub async fn history_seal_window(
&self,
logical_id: &str,
messages: &[SharedMessage],
note: &str,
) -> Result<(Vec<ArchivePart>, String)>
pub async fn history_seal_window( &self, logical_id: &str, messages: &[SharedMessage], note: &str, ) -> Result<(Vec<ArchivePart>, String)>
history_seal for a whole window, as rollover
needs it: the archives the window was sealed as (“parts”, in source
order, never empty) and the note stored with the last one.
The store never fails this for a window over a per-archive limit
(ArchiveStore::seal_window): it cuts the window into several
archives, and a window that fits is the one archive history_seal
makes. The archives record nothing about each other, so the returned
list is the only record of a split. Parts are sealed one at a time: a
failure, or a caller dropped between two of them, leaves the earlier
ones on disk and returns no list; sealing the same window again finds
them and returns the same list.
pub async fn history_search( &self, query: &str, limit: usize, ) -> Result<Vec<ArchiveDescriptor>>
Sourcepub async fn history_search_scan(
&self,
query: &str,
limit: usize,
) -> Result<(Vec<ArchiveDescriptor>, Option<Unscanned>)>
pub async fn history_search_scan( &self, query: &str, limit: usize, ) -> Result<(Vec<ArchiveDescriptor>, Option<Unscanned>)>
history_search that also reports what the
store did not read: None when nothing is missing, otherwise an
Unscanned that says whether the scan budget stopped it
(stopped_after) and whether a shelf, a legacy slot or a file was
passed over because it could not be read (unread).
pub async fn history_fetch( &self, id: &str, start: usize, limit: usize, ) -> Result<Vec<ArchivedMessage>>
pub async fn history_note(&self, id: &str) -> Result<String>
Sourcepub async fn history_forget(&self, id: &str) -> Result<Forgotten>
pub async fn history_forget(&self, id: &str) -> Result<Forgotten>
Forget the archived window id. The store forgets by content:
every file that holds the same window becomes a tombstone, and what
comes back names each one (Forgotten::ids) and says whether a
place that may hold another copy could not be read
(Forgotten::unread); such a copy is still live.
Source§impl MemoryBinding
impl MemoryBinding
Sourcepub fn for_cwd(cwd: Option<PathBuf>) -> Self
pub fn for_cwd(cwd: Option<PathBuf>) -> Self
The binding of a chat that runs in cwd: the base directory, and the
project of that folder. Without a folder, or with one that has no
project, the binding has none and every call through it is refused;
no project is guessed from the process folder. (Under the daemon a
chat’s folder differs from the process folder.)
Immutable execution provenance, not a saved conversation identity or
an authorization grant. Ordinary clones retain this exact author.
Forwarded to extensions as caller on tool.call; an extension’s
forum records it as the run’s author.
Sourcepub fn for_worker(&self) -> Self
pub fn for_worker(&self) -> Self
New worker execution: fork only the author, retaining the captured base and project (including a scope error). Resumed workers get a new actor too; nothing is rediscovered.
pub fn scope(&self) -> Result<&ProjectScope>
pub fn base(&self) -> &Path
pub async fn search( &self, q: ProjectMemoryQuery, ) -> Result<Vec<MemoryDescriptor>>
pub async fn fetch(&self, ids: &[&str]) -> Result<Vec<MemoryRecord>>
pub async fn store(&self, new: NewMemoryRecord) -> Result<MemoryRecord>
pub async fn forget(&self, id: &str) -> Result<()>
Trait Implementations§
Source§impl Clone for MemoryBinding
impl Clone for MemoryBinding
Auto Trait Implementations§
impl Forget for MemoryBinding
impl Freeze for MemoryBinding
impl Move for MemoryBinding
impl RefUnwindSafe for MemoryBinding
impl Send for MemoryBinding
impl Sync for MemoryBinding
impl Unpin for MemoryBinding
impl UnsafeUnpin for MemoryBinding
impl UnwindSafe for MemoryBinding
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.