Struct tokio_jsonrpc::server::AbstractServer
[−]
[src]
pub struct AbstractServer<S: Server>(_);
An RPC server wrapper with dynamic dispatch.
This server wraps another server and converts it into a common ground, so multiple different
servers can be used as trait objects. Basically, it boxes the futures it returns and converts
the result into serde_json::Value
. It can then be used together with
ServerChain
easilly. Note that this conversion incurs
runtime costs.
Methods
impl<S: Server> AbstractServer<S>
[src]
fn new(server: S) -> Self
Wraps another server into an abstract server.
fn into_inner(self) -> S
Unwraps the abstract server and provides the one inside back.
Trait Implementations
impl<S: Server> Server for AbstractServer<S>
[src]
type Success = Value
The successfull result of the RPC call.
type RpcCallResult = BoxRpcCallResult
The result of the RPC call Read more
type NotificationResult = BoxNotificationResult
The result of the RPC call. Read more
fn rpc(
&self,
ctl: &ServerCtl,
method: &str,
params: &Option<Value>
) -> Option<Self::RpcCallResult>
&self,
ctl: &ServerCtl,
method: &str,
params: &Option<Value>
) -> Option<Self::RpcCallResult>
Called when the client requests something. Read more
fn notification(
&self,
ctl: &ServerCtl,
method: &str,
params: &Option<Value>
) -> Option<Self::NotificationResult>
&self,
ctl: &ServerCtl,
method: &str,
params: &Option<Value>
) -> Option<Self::NotificationResult>
Called when the client sends a notification. Read more
fn initialized(&self, ctl: &ServerCtl)
Called when the endpoint is initialized. Read more