Skip to main content

Handler

Trait Handler 

Source
pub trait Handler: Send + Sync {
    // Required method
    fn call(
        &self,
        ctx: &Context,
        input: Value,
    ) -> Result<Value, CapabilityError>;
}
Expand description

The JSON boundary of a handler.

Required Methods§

Source

fn call(&self, ctx: &Context, input: Value) -> Result<Value, CapabilityError>

Run the handler on a JSON input and answer with a JSON output.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§