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;
}