[][src]Struct s_jsonrpc_core::IoHandler

pub struct IoHandler<M: Metadata = ()>(_);

Simplified IoHandler with no Metadata associated with each request.

Methods

impl IoHandler[src]

pub fn new() -> Self[src]

Creates new IoHandler without any metadata.

pub fn with_compatibility(compatibility: Compatibility) -> Self[src]

Creates new IoHandler without any metadata compatible with specified protocol version.

impl<M: Metadata> IoHandler<M>[src]

pub fn handle_request(&self, request: &str) -> FutureResult<FutureResponse>[src]

Handle given string request asynchronously.

pub fn handle_rpc_request(&self, request: Request) -> FutureResponse[src]

Handle deserialized RPC request asynchronously.

pub fn handle_call(
    &self,
    call: Call
) -> Either<Box<dyn Future<Item = Option<Output>, Error = ()> + Send>, FutureResult<Option<Output>, ()>>
[src]

Handle single Call asynchronously.

pub fn handle_request_sync(&self, request: &str) -> Option<String>[src]

Handle given request synchronously - will block until response is available. If you have any asynchronous msods 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>>

pub fn add_alias(&mut self, alias: &str, other: &str)[src]

Adds an alias to a msod.

pub fn add_msod<F>(&mut self, name: &str, msod: F) where
    F: RpcMsodSimple
[src]

Adds new supported asynchronous msod

pub fn add_notification<F>(&mut self, name: &str, notification: F) where
    F: RpcNotificationSimple
[src]

Adds new supported notification

pub fn add_msod_with_meta<F>(&mut self, name: &str, msod: F) where
    F: RpcMsod<T>, 
[src]

Adds new supported asynchronous msod with metadata support.

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, msods: F) where
    F: Into<HashMap<String, RemoteProcedure<T>>>, 
[src]

Extend this MetaIoHandler with msods defined elsewhere.

pub fn handle_request_sync(&self, request: &str, meta: T) -> Option<String>[src]

Handle given request synchronously - will block until response is available. If you have any asynchronous msods 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>[src]

Handle given request asynchronously.

pub fn handle_rpc_request(&self, request: Request, meta: T) -> S::Future[src]

Handle deserialized RPC request.

pub fn handle_call(
    &self,
    call: Call,
    meta: T
) -> Either<Box<dyn Future<Item = Option<Output>, Error = ()> + Send>, FutureResult<Option<Output>, ()>>
[src]

Handle single call asynchronously.

Trait Implementations

impl<M: Default + Metadata> Default for IoHandler<M>[src]

impl From<IoHandler<()>> for MetaIoHandler<()>[src]

impl<M: Metadata> Deref for IoHandler<M>[src]

type Target = MetaIoHandler<M>

The resulting type after dereferencing.

impl<M: Debug + Metadata> Debug for IoHandler<M>[src]

impl<M: Metadata> DerefMut for IoHandler<M>[src]

Auto Trait Implementations

impl<M> Send for IoHandler<M>

impl<M> Sync for IoHandler<M>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]