Trait Client

Source
pub trait Client {
    // Required methods
    fn endpoint(&self, endpoint: &str) -> Result<Url>;
    fn send<'life0, 'async_trait>(
        &'life0 self,
        request: RequestBuilder,
        body: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait representing a client which can communicate with a [Alchemy API] instance via REST.

Required Methods§

Source

fn endpoint(&self, endpoint: &str) -> Result<Url>

Get the URL for the endpoint for the client.

This method adds the hostname for the client’s target instance.

Source

fn send<'life0, 'async_trait>( &'life0 self, request: RequestBuilder, body: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<Response<Bytes>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a REST query asynchronously.

Implementors§