Trait melnet::Endpoint[][src]

pub trait Endpoint<Req: DeserializeOwned, Resp: Serialize>: Send + Sync {
    fn respond(&self, req: Request<Req, Resp>);
}
Expand description

An Endpoint responds to Requests. Requests are responded to by calling Request::respond() rather than by return value to simplify asynchronous handling.

Required methods

Handle a request. This should not block. Implementations should do things like move the Request to background tasks/threads to avoid this.

Implementors