Struct jsonrpc_core::request_handler::RequestHandler
[−]
[src]
pub struct RequestHandler { // some fields omitted }
Requests handler - maps Commander
outputs into well-formed JSONRPC Responses
Methods
impl RequestHandler
[src]
fn new() -> Self
Creates new RequestHandler
fn add_method<C>(&self, name: String, command: Box<C>) where C: MethodCommand + 'static
Adds supported method
fn add_methods(&self, methods: HashMap<String, Box<MethodCommand>>)
Adds supported methods
fn add_notification<C>(&self, name: String, command: Box<C>) where C: NotificationCommand + 'static
Adds supported notification
fn add_notifications(&self, notifications: HashMap<String, Box<NotificationCommand>>)
Adds supported notifications
fn handle_request(&self, request: Request) -> Option<Response>
Handle single request
Some(response)
is returned in case that request is a method call.
None
is returned in case of notifications and empty batches.