Struct tokio_jsonrpc::endpoint::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
The client part of the endpoint.
This can be used to call RPCs and send notifications to the other end. There's no direct constructor, it is created through the Endpoint.
Methods
impl Client
[src]
fn call(
self,
method: String,
params: Option<Value>,
timeout: Option<Duration>
) -> RpcSent
self,
method: String,
params: Option<Value>,
timeout: Option<Duration>
) -> RpcSent
Call a RPC.
Construct an RPC message and send it to the other end. It returns a future that resolves once the message is sent. It yields the Client back (it is blocked for the time of sending) and another future that resolves once the answer is received (or once a timeout happens, in which case the result is None).
fn notify(self, method: String, params: Option<Value>) -> Notified
Send a notification.
It creates a notification message and sends it. It returs a future that resolves once the message is sent and yields the client back for further use.
fn server_ctl(&self) -> &ServerCtl
Get the server control.
That allows terminating the server, etc.
Trait Implementations
impl Clone for Client
[src]
fn clone(&self) -> Client
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more