Trait bonsaidb_client::CustomApiCallback
source · [−]pub trait CustomApiCallback<A: CustomApi>: Send + Sync + 'static {
fn response_received<'life0, 'async_trait>(
&'life0 self,
response: CustomApiResult<A>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn request_response_received<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 CustomApiResult<A>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
}Expand description
A handler of CustomApi responses.
Required methods
fn response_received<'life0, 'async_trait>(
&'life0 self,
response: CustomApiResult<A>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn response_received<'life0, 'async_trait>(
&'life0 self,
response: CustomApiResult<A>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
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
fn request_response_received<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 CustomApiResult<A>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn request_response_received<'life0, 'life1, 'async_trait>(
&'life0 self,
response: &'life1 CustomApiResult<A>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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.