Struct jsonrpc_core::IoHandler
[−]
[src]
pub struct IoHandler<M: Metadata = ()>(_);
Simplified IoHandler
with no Metadata
associated with each request.
Methods
impl IoHandler
[src]
fn new() -> Self
Creates new IoHandler
without any metadata.
fn with_compatibility(compatibility: Compatibility) -> Self
Creates new IoHandler
without any metadata compatible with specified protocol version.
impl<M: Metadata> IoHandler<M>
[src]
fn handle_request(&self, request: &str) -> BoxFuture<Option<String>, ()>
Handle given string request asynchronously.
fn handle_rpc_request(&self, request: Request) -> FutureResponse
Handle deserialized RPC request asynchronously.
fn handle_call(
&self,
call: Call
) -> Either<BoxFuture<Option<Output>, ()>, FutureResult<Option<Output>, ()>>
&self,
call: Call
) -> Either<BoxFuture<Option<Output>, ()>, FutureResult<Option<Output>, ()>>
Handle single Call asynchronously.
fn handle_request_sync(&self, request: &str) -> Option<String>
Handle given request synchronously - will block until response is available.
If you have any asynchronous methods in your RPC it is much wiser to use
handle_request
instead and deal with asynchronous requests in a non-blocking fashion.
Methods from Deref<Target = MetaIoHandler<M>>
fn add_alias(&mut self, alias: &str, other: &str)
Adds an alias to a method.
fn add_method<F>(&mut self, name: &str, method: F) where
F: RpcMethodSync,
F: RpcMethodSync,
Adds new supported synchronous method
fn add_async_method<F>(&mut self, name: &str, method: F) where
F: RpcMethodSimple,
F: RpcMethodSimple,
Adds new supported asynchronous method
fn add_notification<F>(&mut self, name: &str, notification: F) where
F: RpcNotificationSimple,
F: RpcNotificationSimple,
Adds new supported notification
fn add_method_with_meta<F>(&mut self, name: &str, method: F) where
F: RpcMethod<T>,
F: RpcMethod<T>,
Adds new supported asynchronous method with metadata support.
fn add_notification_with_meta<F>(&mut self, name: &str, notification: F) where
F: RpcNotification<T>,
F: RpcNotification<T>,
Adds new supported notification with metadata support.
fn extend_with<F>(&mut self, methods: F) where
F: Into<HashMap<String, RemoteProcedure<T>>>,
F: Into<HashMap<String, RemoteProcedure<T>>>,
Extend this MetaIoHandler
with methods defined elsewhere.
fn handle_request_sync(&self, request: &str, meta: T) -> Option<String>
Handle given request synchronously - will block until response is available.
If you have any asynchronous methods in your RPC it is much wiser to use
handle_request
instead and deal with asynchronous requests in a non-blocking fashion.
fn handle_request(
&self,
request: &str,
meta: T
) -> BoxFuture<Option<String>, ()>
&self,
request: &str,
meta: T
) -> BoxFuture<Option<String>, ()>
Handle given request asynchronously.
fn handle_rpc_request(&self, request: Request, meta: T) -> S::Future
Handle deserialized RPC request.
fn handle_call(
&self,
call: Call,
meta: T
) -> Either<BoxFuture<Option<Output>, ()>, FutureResult<Option<Output>, ()>>
&self,
call: Call,
meta: T
) -> Either<BoxFuture<Option<Output>, ()>, FutureResult<Option<Output>, ()>>
Handle single call asynchronously.
Trait Implementations
impl<M: Default + Metadata> Default for IoHandler<M>
[src]
impl<M: Metadata> Deref for IoHandler<M>
[src]
type Target = MetaIoHandler<M>
The resulting type after dereferencing
fn deref(&self) -> &Self::Target
The method called to dereference a value