pub struct SubagentStore { /* private fields */ }Expand description
Filesystem-backed store rooted at <root> (default ~/.bamboo, injected for tests).
Implementations§
Source§impl SubagentStore
impl SubagentStore
pub fn open(root: impl Into<PathBuf>) -> Self
Sourcepub fn mailbox(&self, loc: &SessionLoc) -> Mailbox
pub fn mailbox(&self, loc: &SessionLoc) -> Mailbox
Mailbox handle for the actor at loc (<session_dir>/mailbox).
pub async fn save_session<T: Serialize>( &self, loc: &SessionLoc, payload: &T, ) -> Result<()>
pub async fn load_session<T: DeserializeOwned>( &self, loc: &SessionLoc, ) -> Result<T>
pub async fn session_exists(&self, loc: &SessionLoc) -> bool
pub async fn list_roots(&self, key: &ProjectKey) -> Result<Vec<RootEntry>>
pub async fn list_children( &self, key: &ProjectKey, parent_id: &str, ) -> Result<Vec<ChildEntry>>
Sourcepub async fn resolve_child(
&self,
key: &ProjectKey,
child_id: &str,
) -> Result<Option<SessionLoc>>
pub async fn resolve_child( &self, key: &ProjectKey, child_id: &str, ) -> Result<Option<SessionLoc>>
O(1) resolve: consult the project child_lookup table.
pub async fn upsert_root( &self, key: &ProjectKey, entry: RootEntry, ) -> Result<()>
pub async fn upsert_child( &self, key: &ProjectKey, parent_id: &str, entry: ChildEntry, ) -> Result<()>
pub async fn remove_child( &self, key: &ProjectKey, parent_id: &str, child_id: &str, ) -> Result<()>
Sourcepub async fn rebuild_index(
&self,
key: &ProjectKey,
extractor: &dyn MetaExtractor,
) -> Result<()>
pub async fn rebuild_index( &self, key: &ProjectKey, extractor: &dyn MetaExtractor, ) -> Result<()>
Rebuild index.json + every children.json by scanning the session payloads.
Authoritative recovery path: safe to call any time; idempotent.
Auto Trait Implementations§
impl !Freeze for SubagentStore
impl !RefUnwindSafe for SubagentStore
impl Send for SubagentStore
impl Sync for SubagentStore
impl Unpin for SubagentStore
impl UnsafeUnpin for SubagentStore
impl UnwindSafe for SubagentStore
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