Skip to main content

Handler

Trait Handler 

Source
pub trait Handler {
    type Input;
    type Output;
    type Error;

    // Required method
    fn handle(&self, input: &Self::Input) -> Result<Self::Output, Self::Error>;
}
Expand description

Handles a dispatched input.

Required Associated Types§

Source

type Input

Input accepted by the handler.

Source

type Output

Value produced by the handler.

Source

type Error

Error produced by the handler.

Required Methods§

Source

fn handle(&self, input: &Self::Input) -> Result<Self::Output, Self::Error>

Handles input and returns an output.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§