Trait bonsaidb::client::CustomApiCallback
source · [−]pub trait CustomApiCallback<A>: 'static + Send + Sync where
A: CustomApi, {
fn response_received<'life0, 'async_trait>(
&'life0 self,
response: Result<<A as CustomApi>::Response, <A as CustomApi>::Error>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn request_response_received<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 Result<<A as CustomApi>::Response, <A as CustomApi>::Error>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
}
Expand description
A handler of CustomApi
responses.
Required methods
An out-of-band response
was received. This happens when the server
sends a response that isn’t in response to a request.
Provided methods
A response was received. Unlike in response_received
this response
will be returned to the original requestor. This is invoked before the
requestor recives the response.