pub trait RequestHandler<T>: Sync + Send {
// Required methods
fn handle_request<'life0, 'async_trait>(
&'life0 self,
req: JsonRequest,
) -> Pin<Box<dyn Future<Output = JsonResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn connections_mut<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = MutexGuard<'life0, HashSet<StoppableTaskPtr>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn pong<'life0, 'async_trait>(
&'life0 self,
id: u16,
_params: JsonValue,
) -> Pin<Box<dyn Future<Output = JsonResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn connections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<StoppableTaskPtr>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn mark_connection<'life0, 'async_trait>(
&'life0 self,
task: StoppableTaskPtr,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn unmark_connection<'life0, 'async_trait>(
&'life0 self,
task: StoppableTaskPtr,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn active_connections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn stop_connections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Asynchronous trait implementing a handler for incoming JSON-RPC requests.