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§
Sourcefn handle_request(&self, request: Request) -> Response
fn handle_request(&self, request: Request) -> Response
Handle a JSON-RPC request and return a response
Sourcefn handle_notification(&self, notification: Notification)
fn handle_notification(&self, notification: Notification)
Handle a JSON-RPC notification (no response expected)
Provided Methods§
Sourcefn supports_method(&self, method: &str) -> bool
fn supports_method(&self, method: &str) -> bool
Check if a method is supported
Sourcefn get_supported_methods(&self) -> Vec<String>
fn get_supported_methods(&self) -> Vec<String>
Get list of supported methods
Sourcefn get_method_info(&self, method: &str) -> Option<MethodInfo>
fn get_method_info(&self, method: &str) -> Option<MethodInfo>
Get method information for documentation