StatefulHandler

Trait StatefulHandler 

Source
pub trait StatefulHandler<C: ServiceContext>: Send + Sync {
    // Required method
    fn handle_request(
        &self,
        context: &C,
        request: Request,
    ) -> Result<Response, C::Error>;

    // Provided method
    fn handle_notification(
        &self,
        context: &C,
        notification: Notification,
    ) -> Result<(), C::Error> { ... }
}
Expand description

Trait for stateful JSON-RPC handlers

Required Methods§

Source

fn handle_request( &self, context: &C, request: Request, ) -> Result<Response, C::Error>

Handle a JSON-RPC request with access to shared context

Provided Methods§

Source

fn handle_notification( &self, context: &C, notification: Notification, ) -> Result<(), C::Error>

Handle a JSON-RPC notification with access to shared context

Implementors§