Skip to main content

Provider

Trait Provider 

Source
pub trait Provider: Send + Sync {
    // Required methods
    fn request_json<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        method: Method,
        path: &'life1 str,
        query: &'life2 [(&'life3 str, String)],
        body: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<Value, AElfError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn request_text<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        method: Method,
        path: &'life1 str,
        query: &'life2 [(&'life3 str, String)],
        body: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<String, AElfError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
}
Expand description

Abstract transport used by the SDK client.

Required Methods§

Source

fn request_json<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, method: Method, path: &'life1 str, query: &'life2 [(&'life3 str, String)], body: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<Value, AElfError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Sends a request and parses the response body as JSON.

Source

fn request_text<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, method: Method, path: &'life1 str, query: &'life2 [(&'life3 str, String)], body: Option<Value>, ) -> Pin<Box<dyn Future<Output = Result<String, AElfError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Sends a request and returns the raw response text.

Implementors§