pub trait Bridge {
// Required methods
fn tool_request(
&mut self,
name: &str,
args: &Value,
deadline: Instant,
) -> Option<(Value, bool)>;
fn budget_request(
&mut self,
estimate: u64,
deadline: Instant,
) -> Option<BudgetReply>;
fn cancelled(&self) -> bool;
// Provided method
fn progress(&mut self, _event: &str, _fields: Value) { ... }
}Expand description
The supervisor link: internal-tool and budget round-trips + cancellation.
Required Methods§
Sourcefn tool_request(
&mut self,
name: &str,
args: &Value,
deadline: Instant,
) -> Option<(Value, bool)>
fn tool_request( &mut self, name: &str, args: &Value, deadline: Instant, ) -> Option<(Value, bool)>
Execute an internal tool via the supervisor. None = no answer
(cancelled / channel gone / deadline).
Sourcefn budget_request(
&mut self,
estimate: u64,
deadline: Instant,
) -> Option<BudgetReply>
fn budget_request( &mut self, estimate: u64, deadline: Instant, ) -> Option<BudgetReply>
Ask for budget admission. None = no answer.
fn cancelled(&self) -> bool
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".