Struct jsonrpc_core::IoHandler [−][src]
Simplified IoHandler
with no Metadata
associated with each request.
Implementations
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 + Default> IoHandler<M>
[src]
pub fn handle_request(
&self,
request: &str
) -> FutureResult<FutureResponse, FutureOutput>
[src]
&self,
request: &str
) -> FutureResult<FutureResponse, FutureOutput>
Handle given string request asynchronously.
pub fn handle_rpc_request(
&self,
request: Request
) -> FutureRpcResult<FutureResponse, FutureOutput>
[src]
&self,
request: Request
) -> FutureRpcResult<FutureResponse, FutureOutput>
Handle deserialized RPC request asynchronously.
pub fn handle_call(
&self,
call: Call
) -> Either<FutureOutput, Either<FutureOutput, FutureResult<Option<Output>, ()>>>
[src]
&self,
call: Call
) -> Either<FutureOutput, Either<FutureOutput, FutureResult<Option<Output>, ()>>>
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 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>>
pub fn add_alias(&mut self, alias: &str, other: &str)
[src]
Adds an alias to a method.
pub fn add_method<F>(&mut self, name: &str, method: F) where
F: RpcMethodSimple,
[src]
F: RpcMethodSimple,
Adds new supported asynchronous method
pub fn add_notification<F>(&mut self, name: &str, notification: F) where
F: RpcNotificationSimple,
[src]
F: RpcNotificationSimple,
Adds new supported notification
pub fn add_method_with_meta<F>(&mut self, name: &str, method: F) where
F: RpcMethod<T>,
[src]
F: RpcMethod<T>,
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]
F: RpcNotification<T>,
Adds new supported notification with metadata support.
pub fn extend_with<F>(&mut self, methods: F) where
F: IntoIterator<Item = (String, RemoteProcedure<T>)>,
[src]
F: IntoIterator<Item = (String, RemoteProcedure<T>)>,
Extend this MetaIoHandler
with methods 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 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]
&self,
request: &str,
meta: T
) -> FutureResult<S::Future, S::CallFuture>
Handle given request asynchronously.
pub fn handle_rpc_request(
&self,
request: Request,
meta: T
) -> FutureRpcResult<S::Future, S::CallFuture>
[src]
&self,
request: Request,
meta: T
) -> FutureRpcResult<S::Future, S::CallFuture>
Handle deserialized RPC request.
pub fn handle_call(
&self,
call: Call,
meta: T
) -> Either<S::CallFuture, Either<FutureOutput, FutureResult<Option<Output>, ()>>>
[src]
&self,
call: Call,
meta: T
) -> Either<S::CallFuture, Either<FutureOutput, FutureResult<Option<Output>, ()>>>
Handle single call asynchronously.
pub fn iter(&self) -> impl Iterator<Item = (&String, &RemoteProcedure<T>)>
[src]
Returns an iterator visiting all methods in arbitrary order.
Trait Implementations
impl<M: Clone + Metadata> Clone for IoHandler<M>
[src]
impl<M: Debug + Metadata> Debug for IoHandler<M>
[src]
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
[src]
impl<M: Metadata> DerefMut for IoHandler<M>
[src]
impl From<IoHandler<()>> for MetaIoHandler<()>
[src]
impl<T: Metadata> IntoIterator for IoHandler<T>
[src]
type Item = <MetaIoHandler<T> as IntoIterator>::Item
The type of the elements being iterated over.
type IntoIter = <MetaIoHandler<T> as IntoIterator>::IntoIter
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<M: Metadata> IoHandlerExtension<M> for IoHandler<M>
[src]
fn augment<S: Middleware<M>>(self, handler: &mut MetaIoHandler<M, S>)
[src]
Auto Trait Implementations
impl<M = ()> !RefUnwindSafe for IoHandler<M>
impl<M> Send for IoHandler<M>
impl<M> Sync for IoHandler<M>
impl<M> Unpin for IoHandler<M>
impl<M = ()> !UnwindSafe for IoHandler<M>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,