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§
Sourcefn config(&self) -> &ApiConnectorConfig
fn config(&self) -> &ApiConnectorConfig
Connector configuration
Sourcefn 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,
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