HttpClient

Trait HttpClient 

Source
pub trait HttpClient {
    // Required methods
    fn post<'life0, 'async_trait>(
        &'life0 self,
        payload: SelfDescribingJson,
    ) -> Pin<Box<dyn Future<Output = Result<u16, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clone(&self) -> Box<dyn HttpClient + Send + Sync>;
}
Expand description

A HttpClient is responsible for sending events to the collector.

This is an async trait, using the async_trait crate.

Implement this trait to use your own HttpClient implementation on an Emitter.

Required Methods§

Source

fn post<'life0, 'async_trait>( &'life0 self, payload: SelfDescribingJson, ) -> Pin<Box<dyn Future<Output = Result<u16, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a SelfDescribingJson to the collector via POST

Source

fn clone(&self) -> Box<dyn HttpClient + Send + Sync>

Duplicate the HttpClient

Implementors§