Skip to main content

Bridge

Trait Bridge 

Source
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§

Source

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).

Source

fn budget_request( &mut self, estimate: u64, deadline: Instant, ) -> Option<BudgetReply>

Ask for budget admission. None = no answer.

Source

fn cancelled(&self) -> bool

Provided Methods§

Source

fn progress(&mut self, _event: &str, _fields: Value)

A progress event (liveness).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§