ApiRequestHook

Type Alias ApiRequestHook 

Source
pub type ApiRequestHook = Arc<dyn Fn(DynIRawFederationApi) -> DynIRawFederationApi + Send + Sync + 'static>;
Expand description

“Api Request Hook”

An “api request hook” is a function that gets a raw federation api and can either pass it unmodified (no hook) or wrap it in whatever custom logic and return as a new raw federation api, possibly forwarding the call to the original one.

This is meant to allow downstream users to add custom logic for debugging, testing (e.g. simulating network being down), collecting stats, notifying about slow calls, errors, etc.

Aliased Type§

pub struct ApiRequestHook { /* private fields */ }