Skip to main content

Handler

Trait Handler 

Source
pub trait Handler: Send + Sync {
    // Required method
    fn handle(&self, req: Inbound) -> Option<Answer>;
}
Expand description

The host’s answering surface. Implemented by the embedder; None anywhere means “we did not advertise that capability”, and the request is refused.

Required Methods§

Source

fn handle(&self, req: Inbound) -> Option<Answer>

Answer a server→client request. Returning None declines the capability itself (the caller turns that into -32601).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§