Skip to main content

ChildSessionPort

Trait ChildSessionPort 

Source
pub trait ChildSessionPort: Send + Sync {
Show 14 methods // Required methods fn load_root_session<'life0, 'life1, 'async_trait>( &'life0 self, root_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Session, ChildSessionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn load_child_for_parent<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent_id: &'life1 str, child_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Session, ChildSessionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn save_child_session<'life0, 'life1, 'async_trait>( &'life0 self, child: &'life1 mut Session, ) -> Pin<Box<dyn Future<Output = Result<(), ChildSessionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn is_child_running<'life0, 'life1, 'async_trait>( &'life0 self, child_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_children<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Vec<ChildSessionEntry>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn enqueue_child_run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent: &'life1 Session, child: &'life2 Session, ) -> Pin<Box<dyn Future<Output = Result<(), ChildSessionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn cancel_child_run_and_wait<'life0, 'life1, 'async_trait>( &'life0 self, child_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ChildSessionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_child_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent_id: &'life1 str, child_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<DeleteChildResult, ChildSessionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_child_runner_info<'life0, 'life1, 'async_trait>( &'life0 self, child_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<ChildRunnerInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn register_parent_wait_for_child<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, parent_session_id: &'life1 str, child_session_id: &'life2 str, tool_call_id: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ChildSessionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn register_parent_wait_for_children<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent_session_id: &'life1 str, child_session_ids: &'life2 [String], policy: ChildWaitPolicy, ) -> Pin<Box<dyn Future<Output = Result<usize, ChildSessionError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn active_child_ids<'life0, 'life1, 'async_trait>( &'life0 self, parent_session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn find_resident_child<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, root_session_id: &'life1 str, resident_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn ensure_child_indexed<'life0, 'life1, 'async_trait>( &'life0 self, child_session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}

Required Methods§

Source

fn load_root_session<'life0, 'life1, 'async_trait>( &'life0 self, root_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Session, ChildSessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn load_child_for_parent<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent_id: &'life1 str, child_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Session, ChildSessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn save_child_session<'life0, 'life1, 'async_trait>( &'life0 self, child: &'life1 mut Session, ) -> Pin<Box<dyn Future<Output = Result<(), ChildSessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn is_child_running<'life0, 'life1, 'async_trait>( &'life0 self, child_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn list_children<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Vec<ChildSessionEntry>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn enqueue_child_run<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent: &'life1 Session, child: &'life2 Session, ) -> Pin<Box<dyn Future<Output = Result<(), ChildSessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn cancel_child_run_and_wait<'life0, 'life1, 'async_trait>( &'life0 self, child_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ChildSessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete_child_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent_id: &'life1 str, child_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<DeleteChildResult, ChildSessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_child_runner_info<'life0, 'life1, 'async_trait>( &'life0 self, child_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<ChildRunnerInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return live diagnostic info for a running child session, if available.

Source

fn register_parent_wait_for_child<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, parent_session_id: &'life1 str, child_session_id: &'life2 str, tool_call_id: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<(), ChildSessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Register a durable parent wait for a single enqueued child. Idempotent and coalesced per parent (concurrent sibling spawns merge into one write).

Source

fn register_parent_wait_for_children<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parent_session_id: &'life1 str, child_session_ids: &'life2 [String], policy: ChildWaitPolicy, ) -> Pin<Box<dyn Future<Output = Result<usize, ChildSessionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Register a durable parent wait over an explicit set of children with a chosen policy (the SubAgent.wait action). Returns the number of children the wait now covers (0 = nothing to wait on).

Source

fn active_child_ids<'life0, 'life1, 'async_trait>( &'life0 self, parent_session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

The parent’s currently-active (non-terminal) child session ids.

Source

fn find_resident_child<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, root_session_id: &'life1 str, resident_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find an existing resident agent in the same root tree by its stable resident_name, returning its child session id if one exists. Used to reuse a resident agent for a new task instead of minting a new child. Index-backed (matches root_session_id + metadata["resident_name"]).

Source

fn ensure_child_indexed<'life0, 'life1, 'async_trait>( &'life0 self, child_session_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Best-effort: ensure the child’s session-index entry is visible immediately after creation (the index is otherwise eventually consistent). Failures are ignored by the caller.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§