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§
Provided Methods§
Sourcefn handle_notification(
&self,
context: &C,
notification: Notification,
) -> Result<(), C::Error>
fn handle_notification( &self, context: &C, notification: Notification, ) -> Result<(), C::Error>
Handle a JSON-RPC notification with access to shared context