Trait msgpack_rpc::Handler
[−]
[src]
pub trait Handler: 'static {
type RequestFuture: Future<Item = Value, Error = Value>;
type NotifyFuture: Future<Item = (), Error = ()>;
fn handle_request(
&self,
method: &str,
params: Value,
client: &Client
) -> Self::RequestFuture;
fn handle_notification(
&self,
method: &str,
params: Value,
client: &Client
) -> Self::NotifyFuture;
}A handler of requests/notifications.
Associated Types
type RequestFuture: Future<Item = Value, Error = Value>
The future returned from Self::handle_request()
type NotifyFuture: Future<Item = (), Error = ()>
The future returned from Self::handle_notification()
Required Methods
fn handle_request(
&self,
method: &str,
params: Value,
client: &Client
) -> Self::RequestFuture
&self,
method: &str,
params: Value,
client: &Client
) -> Self::RequestFuture
Handler function to handle a request.
fn handle_notification(
&self,
method: &str,
params: Value,
client: &Client
) -> Self::NotifyFuture
&self,
method: &str,
params: Value,
client: &Client
) -> Self::NotifyFuture
Handler function to handle a notification.
Implementors
impl<H: Handler> Handler for Box<H> type RequestFuture = H::RequestFuture; type NotifyFuture = H::NotifyFuture;impl<H: Handler> Handler for Rc<H> type RequestFuture = H::RequestFuture; type NotifyFuture = H::NotifyFuture;impl<H: Handler> Handler for Arc<H> type RequestFuture = H::RequestFuture; type NotifyFuture = H::NotifyFuture;