breez_sdk_liquid

Trait RestClient

pub trait RestClient: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(String, u16), ServiceConnectivityError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn post<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        headers: Option<HashMap<String, String>>,
        body: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(String, u16), ServiceConnectivityError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}

Required Methods§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(String, u16), ServiceConnectivityError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Makes a GET request and logs on DEBUG.

§Arguments
  • url: the URL on which GET will be called

fn post<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, headers: Option<HashMap<String, String>>, body: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(String, u16), ServiceConnectivityError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Makes a POST request, and logs on DEBUG.

§Arguments
  • url: the URL on which POST will be called
  • headers: the optional POST headers
  • body: the optional POST body

Implementors§