pub trait ServiceWithClient {
type RequestFuture: Future<Output = Result<Value, Value>> + 'static + Send;
// Required methods
fn handle_request(
&mut self,
client: &mut Client,
method: &str,
params: &[Value],
) -> Self::RequestFuture;
fn handle_notification(
&mut self,
client: &mut Client,
method: &str,
params: &[Value],
);
}
Expand description
Required Associated Types§
Sourcetype RequestFuture: Future<Output = Result<Value, Value>> + 'static + Send
type RequestFuture: Future<Output = Result<Value, Value>> + 'static + Send
The type of future returned by handle_request
.
Required Methods§
Sourcefn handle_request(
&mut self,
client: &mut Client,
method: &str,
params: &[Value],
) -> Self::RequestFuture
fn handle_request( &mut self, client: &mut Client, method: &str, params: &[Value], ) -> Self::RequestFuture
Handle a MessagePack-RPC
request.
This differs from Service::handle_request
in that you also get
access to a Client
for sending requests and notifications.
Sourcefn handle_notification(
&mut self,
client: &mut Client,
method: &str,
params: &[Value],
)
fn handle_notification( &mut self, client: &mut Client, method: &str, params: &[Value], )
Handle a MessagePack-RPC
notification.
This differs from Service::handle_notification
in that
you also get access to a Client
for sending requests and notifications.