Skip to main content

Dispatch

Trait Dispatch 

Source
pub trait Dispatch {
    // Required methods
    fn commands(&self) -> Vec<CommandInfo>;
    fn execute(
        &mut self,
        id: &str,
        params: Value,
    ) -> Result<Value, CommandError>;
}
Expand description

CONTRACT: anything that can list and run commands. Implemented by Registry-backed sessions, by the control-port client (remote app) and by test doubles. Object-safe.

Required Methods§

Source

fn commands(&self) -> Vec<CommandInfo>

Source

fn execute(&mut self, id: &str, params: Value) -> Result<Value, CommandError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<S: Host> Dispatch for Bound<'_, S>