Trait darkfi::rpc::server::RequestHandler

source ·
pub trait RequestHandler: 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<'_, 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.

Required Methods§

source

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,

source

fn connections_mut<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = MutexGuard<'_, HashSet<StoppableTaskPtr>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

source

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,

source

fn connections<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<StoppableTaskPtr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

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,

source

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,

source

fn active_connections<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn stop_connections<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§