Struct jsonrpc_core::MetaIoHandler [−][src]
pub struct MetaIoHandler<T: Metadata, S: Middleware<T> = Noop> { /* fields omitted */ }
Expand description
Request handler
By default compatible only with jsonrpc v2
Implementations
Creates new MetaIoHandler
compatible with specified protocol version.
Creates new MetaIoHandler
Creates new MetaIoHandler
with specified middleware.
Adds new supported synchronous method.
A backward-compatible wrapper.
Adds new supported asynchronous method.
pub fn add_notification<F>(&mut self, name: &str, notification: F) where
F: RpcNotificationSimple,
[src]
pub fn add_notification<F>(&mut self, name: &str, notification: F) where
F: RpcNotificationSimple,
[src]Adds new supported notification
Adds new supported asynchronous method with metadata support.
pub fn add_notification_with_meta<F>(&mut self, name: &str, notification: F) where
F: RpcNotification<T>,
[src]
pub fn add_notification_with_meta<F>(&mut self, name: &str, notification: F) where
F: RpcNotification<T>,
[src]Adds new supported notification with metadata support.
pub fn extend_with<F>(&mut self, methods: F) where
F: IntoIterator<Item = (String, RemoteProcedure<T>)>,
[src]
pub fn extend_with<F>(&mut self, methods: F) where
F: IntoIterator<Item = (String, RemoteProcedure<T>)>,
[src]Extend this MetaIoHandler
with methods defined elsewhere.
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.
pub fn handle_request(
&self,
request: &str,
meta: T
) -> FutureResult<S::Future, S::CallFuture>
[src]
pub fn handle_request(
&self,
request: &str,
meta: T
) -> FutureResult<S::Future, S::CallFuture>
[src]Handle given request asynchronously.
pub fn handle_rpc_request(
&self,
request: Request,
meta: T
) -> FutureRpcResult<S::Future, S::CallFuture>
[src]
pub fn handle_rpc_request(
&self,
request: Request,
meta: T
) -> FutureRpcResult<S::Future, S::CallFuture>
[src]Handle deserialized RPC request.
pub fn handle_call(
&self,
call: Call,
meta: T
) -> Either<S::CallFuture, Either<FutureOutput, Ready<Option<Output>>>>
[src]
pub fn handle_call(
&self,
call: Call,
meta: T
) -> Either<S::CallFuture, Either<FutureOutput, Ready<Option<Output>>>>
[src]Handle single call asynchronously.
Trait Implementations
Extend given handler
with additional methods.
Auto Trait Implementations
impl<T, S = Noop> !RefUnwindSafe for MetaIoHandler<T, S>
impl<T, S> Send for MetaIoHandler<T, S>
impl<T, S> Sync for MetaIoHandler<T, S>
impl<T, S> Unpin for MetaIoHandler<T, S> where
S: Unpin,
impl<T, S = Noop> !UnwindSafe for MetaIoHandler<T, S>
Blanket Implementations
Mutably borrows from an owned value. Read more