pub trait AsyncSynapseHandler: Send + Sync {
// Required method
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
synapse_type: &'life1 str,
data: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Async synapse request handler.
Preferred over SynapseHandler when the handler performs I/O or other async work.
Required Methods§
Sourcefn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
synapse_type: &'life1 str,
data: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 self,
synapse_type: &'life1 str,
data: HashMap<String, Value>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Processes the request asynchronously and returns the response payload map.