Skip to main content

from_fn

Function from_fn 

Source
pub fn from_fn<F, Fut>(f: F) -> impl IrohRequestProcessor
where F: Fn(Bytes) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<Bytes>> + Send + 'static,
Expand description

Convenience: build an IrohRequestProcessor from a Send + Sync async closure. Useful for tests. The closure is carrier-agnostic and is therefore restricted to trusted inproc/UDS carriers. It cannot receive bytes from an untrusted carrier.