pub trait NestedSpawnHandler: Send + Sync {
// Required method
fn spawn_nested<'life0, 'life1, 'async_trait>(
&'life0 self,
child_session_id: &'life1 str,
request: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Fulfils a child worker’s nested SubAgent spawn request on the host (Phase 6:
nested execution). When a child wants a grandchild, its host.subagent_call
arrives as a ChildFrame::SubagentRequest; an implementation runs the real
spawn (parenting the grandchild under the requesting child) and returns the
SubAgent tool’s result JSON. With no handler wired the host replies with a
graceful error so the child’s tool fails cleanly instead of hanging.
Required Methods§
Sourcefn spawn_nested<'life0, 'life1, 'async_trait>(
&'life0 self,
child_session_id: &'life1 str,
request: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn spawn_nested<'life0, 'life1, 'async_trait>(
&'life0 self,
child_session_id: &'life1 str,
request: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run a nested SubAgent spawn requested by child_session_id; request is
the SubAgent tool-call body. Returns the tool-result JSON, or an error
string (surfaced to the child as a failed tool result).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".