pub trait Host: Send {
// Required methods
fn render_tool_call(&mut self, call: &ToolCall) -> Result<String>;
fn execute_tool<'a>(
&'a mut self,
call: ToolCall,
operation_id: Uuid,
budget: ContextBudget,
) -> HostFuture<'a, ToolOutcome>;
fn complete_capture<'a>(
&'a mut self,
capture: Value,
contents: String,
budget: ContextBudget,
) -> HostFuture<'a, ToolOutcome>;
fn record(&mut self, event: AuditEvent) -> Result<()>;
}Expand description
Application-owned behavior invoked by the generic subagent loop.
Required Methods§
Sourcefn render_tool_call(&mut self, call: &ToolCall) -> Result<String>
fn render_tool_call(&mut self, call: &ToolCall) -> Result<String>
Renders the retained invocation text before execution.
Sourcefn execute_tool<'a>(
&'a mut self,
call: ToolCall,
operation_id: Uuid,
budget: ContextBudget,
) -> HostFuture<'a, ToolOutcome>
fn execute_tool<'a>( &'a mut self, call: ToolCall, operation_id: Uuid, budget: ContextBudget, ) -> HostFuture<'a, ToolOutcome>
Executes one application tool.
Sourcefn complete_capture<'a>(
&'a mut self,
capture: Value,
contents: String,
budget: ContextBudget,
) -> HostFuture<'a, ToolOutcome>
fn complete_capture<'a>( &'a mut self, capture: Value, contents: String, budget: ContextBudget, ) -> HostFuture<'a, ToolOutcome>
Completes an opaque freeform capture requested by a prior tool result.
Sourcefn record(&mut self, event: AuditEvent) -> Result<()>
fn record(&mut self, event: AuditEvent) -> Result<()>
Records one durable audit event selected by the runtime.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".