Struct jsonrpc_pubsub::PubSubHandler
[−]
[src]
pub struct PubSubHandler<T: PubSubMetadata, S: Middleware<T> = NoopMiddleware> { /* fields omitted */ }
Publish-Subscribe extension of IoHandler
.
Methods
impl<T: PubSubMetadata, S: Middleware<T>> PubSubHandler<T, S>
[src]
fn new(handler: MetaIoHandler<T, S>) -> Self
[src]
Creates new PubSubHandler
fn add_subscription<F, G>(
&mut self,
notification: &str,
subscribe: (&str, F),
unsubscribe: (&str, G)
) where
F: SubscribeRpcMethod<T>,
G: UnsubscribeRpcMethod,
[src]
&mut self,
notification: &str,
subscribe: (&str, F),
unsubscribe: (&str, G)
) where
F: SubscribeRpcMethod<T>,
G: UnsubscribeRpcMethod,
Adds new subscription.
Methods from Deref<Target = MetaIoHandler<T, S>>
fn add_alias(&mut self, alias: &str, other: &str)
[src]
Adds an alias to a method.
fn add_method<F>(&mut self, name: &str, method: F) where
F: RpcMethodSync,
[src]
F: RpcMethodSync,
Adds new supported synchronous method
fn add_async_method<F>(&mut self, name: &str, method: F) where
F: RpcMethodSimple,
[src]
F: RpcMethodSimple,
Adds new supported asynchronous method
fn add_notification<F>(&mut self, name: &str, notification: F) where
F: RpcNotificationSimple,
[src]
F: RpcNotificationSimple,
Adds new supported notification
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.
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.
fn extend_with<F>(&mut self, methods: F) where
F: Into<HashMap<String, RemoteProcedure<T>, RandomState>>,
[src]
F: Into<HashMap<String, RemoteProcedure<T>, RandomState>>,
Extend this MetaIoHandler
with methods defined elsewhere.
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.
fn handle_request(
&self,
request: &str,
meta: T
) -> Box<Future<Item = Option<String>, Error = ()> + 'static + Send>
[src]
&self,
request: &str,
meta: T
) -> Box<Future<Item = Option<String>, Error = ()> + 'static + Send>
Handle given request asynchronously.
fn handle_rpc_request(
&self,
request: Request,
meta: T
) -> <S as Middleware<T>>::Future
[src]
&self,
request: Request,
meta: T
) -> <S as Middleware<T>>::Future
Handle deserialized RPC request.
fn handle_call(
&self,
call: Call,
meta: T
) -> Either<Box<Future<Item = Option<Output>, Error = ()> + 'static + Send>, FutureResult<Option<Output>, ()>>
[src]
&self,
call: Call,
meta: T
) -> Either<Box<Future<Item = Option<Output>, Error = ()> + 'static + Send>, FutureResult<Option<Output>, ()>>
Handle single call asynchronously.
Trait Implementations
impl<T: PubSubMetadata> Default for PubSubHandler<T>
[src]
impl<T: PubSubMetadata, S: Middleware<T>> Deref for PubSubHandler<T, S>
[src]
type Target = MetaIoHandler<T, S>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.
impl<T: PubSubMetadata, S: Middleware<T>> DerefMut for PubSubHandler<T, S>
[src]
impl<T: PubSubMetadata, S: Middleware<T>> Into<MetaIoHandler<T, S>> for PubSubHandler<T, S>
[src]
fn into(self) -> MetaIoHandler<T, S>
[src]
Performs the conversion.