pub trait Handler {
    type Metadata: PubSubMetadata + Unpin + Debug;

    // Required methods
    fn add_method<F>(&mut self, name: &str, method: F)
       where F: RpcMethodSimple;
    fn add_subscription<F, G>(
        &mut self,
        notification: &str,
        subscribe: (&str, F),
        unsubscribe: (&str, G)
    )
       where F: SubscribeRpcMethod<Self::Metadata>,
             G: UnsubscribeRpcMethod<Self::Metadata>;
    fn as_meta_io_handler(&self) -> MetaIoHandler<Self::Metadata>;
    fn describe_api(&self) -> Vec<String>;
    fn handle_request_sync(
        &self,
        request: &str,
        meta: Self::Metadata
    ) -> Option<String>;
    fn metadata_from_sender(sender: UnboundedSender<String>) -> Self::Metadata;
    fn new() -> Self;
}

Required Associated Types§

Required Methods§

source

fn add_method<F>(&mut self, name: &str, method: F)where F: RpcMethodSimple,

source

fn add_subscription<F, G>( &mut self, notification: &str, subscribe: (&str, F), unsubscribe: (&str, G) )where F: SubscribeRpcMethod<Self::Metadata>, G: UnsubscribeRpcMethod<Self::Metadata>,

source

fn as_meta_io_handler(&self) -> MetaIoHandler<Self::Metadata>

source

fn describe_api(&self) -> Vec<String>

source

fn handle_request_sync( &self, request: &str, meta: Self::Metadata ) -> Option<String>

source

fn metadata_from_sender(sender: UnboundedSender<String>) -> Self::Metadata

source

fn new() -> Self

Implementors§