Skip to main content

HandlerFactory

Trait HandlerFactory 

Source
pub trait HandlerFactory:
    Send
    + Sync
    + 'static {
    // Required methods
    fn mode(&self) -> Mode;
    fn build(&self, ctx: &WorkerCtx) -> Box<dyn Handler>;
}
Expand description

Builds a Handler for each worker.

Required Methods§

Source

fn mode(&self) -> Mode

Handler mode (affects listener wiring).

Source

fn build(&self, ctx: &WorkerCtx) -> Box<dyn Handler>

Constructs the per-worker handler.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§