Trait DataSource

Source
pub trait DataSource<R: Request>:
    Send
    + Sync
    + 'static
    + Clone {
    // Required method
    fn derive_response_for<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 R,
    ) -> Pin<Box<dyn Future<Output = Result<R::Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

The trait that allows the [RequestResponseProtocol] to calculate/derive a response for a specific request

Required Methods§

Source

fn derive_response_for<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 R, ) -> Pin<Box<dyn Future<Output = Result<R::Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Calculate/derive the response for a specific request

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§