ApiConnector

Trait ApiConnector 

Source
pub trait ApiConnector: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn config(&self) -> &ApiConnectorConfig;
    fn make_request<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        method: &'life1 str,
        endpoint: &'life2 str,
        body: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for third-party API connectors.

Required Methods§

Source

fn name(&self) -> &str

Connector name

Source

fn config(&self) -> &ApiConnectorConfig

Connector configuration

Source

fn make_request<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, method: &'life1 str, endpoint: &'life2 str, body: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Make a request to the API

Implementors§