Handler

Trait Handler 

Source
pub trait Handler {
    // Required methods
    fn handle_request(&self, request: Request) -> Response;
    fn handle_notification(&self, notification: Notification);

    // Provided methods
    fn supports_method(&self, method: &str) -> bool { ... }
    fn get_supported_methods(&self) -> Vec<String> { ... }
    fn get_method_info(&self, method: &str) -> Option<MethodInfo> { ... }
}
Expand description

Trait for handling JSON-RPC requests and notifications

Required Methods§

Source

fn handle_request(&self, request: Request) -> Response

Handle a JSON-RPC request and return a response

Source

fn handle_notification(&self, notification: Notification)

Handle a JSON-RPC notification (no response expected)

Provided Methods§

Source

fn supports_method(&self, method: &str) -> bool

Check if a method is supported

Source

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

Get list of supported methods

Source

fn get_method_info(&self, method: &str) -> Option<MethodInfo>

Get method information for documentation

Implementors§