Trait rmp_rpc::ServiceWithClient
[−]
[src]
pub trait ServiceWithClient { type RequestFuture: IntoStaticFuture<Item = Value, Error = Value>; 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]
); }
This is a beefed-up version of Service
, in which the various handler
methods also get access to a Client
, which allows them to send requests and
notifications to the same msgpack-rpc client that made the original request.
Associated Types
type RequestFuture: IntoStaticFuture<Item = Value, Error = Value>
The type of future returned by handle_request
.
Required Methods
fn handle_request(
&mut self,
client: &mut Client,
method: &str,
params: &[Value]
) -> Self::RequestFuture
&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.
fn handle_notification(
&mut self,
client: &mut Client,
method: &str,
params: &[Value]
)
&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.
Implementors
impl<S: Service> ServiceWithClient for S type RequestFuture = <S as Service>::RequestFuture;