Skip to main content

Handler

Trait Handler 

Source
pub trait Handler<Q, R>:
    Send
    + Sync
    + 'static {
    // Required method
    fn request(&self, from: &PeerId, req: Q) -> R;

    // Provided method
    fn seen(&self, _s: Sighting) { ... }
}
Expand description

Answers requests from peers. The peer id is the one Noise authenticated.

Required Methods§

Source

fn request(&self, from: &PeerId, req: Q) -> R

Provided Methods§

Source

fn seen(&self, _s: Sighting)

A peer was discovered or identified.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§