pub struct Builder {
pub base_url: String,
pub proxy: Option<String>,
pub timeout: Option<u64>,
pub headers: HashMap<String, String>,
pub max_retries: usize,
}
Fields§
§base_url: String
The URL of the Esplora server.
proxy: Option<String>
Optional URL of the proxy to use to make requests to the Esplora server
The string should be formatted as:
<protocol>://<user>:<password>@host:<port>
.
Note that the format of this value and the supported protocols change
slightly between the blocking version of the client (using minreq
)
and the async version (using reqwest
). For more details check with
the documentation of the two crates. Both of them are compiled with
the socks
feature enabled.
The proxy is ignored when targeting wasm32
.
timeout: Option<u64>
Socket timeout.
headers: HashMap<String, String>
HTTP headers to set on every request made to Esplora server.
max_retries: usize
Max retries
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn max_retries(self, count: usize) -> Self
pub fn max_retries(self, count: usize) -> Self
Set the maximum number of times to retry a request if the response status
is one of RETRYABLE_ERROR_CODES
.
Sourcepub fn build_blocking(self) -> BlockingClient
pub fn build_blocking(self) -> BlockingClient
Build a blocking client from builder
Sourcepub fn build_async(self) -> Result<AsyncClient, Error>
pub fn build_async(self) -> Result<AsyncClient, Error>
Build an asynchronous client from builder
Sourcepub fn build_async_with_sleeper<S: Sleeper>(
self,
) -> Result<AsyncClient<S>, Error>
pub fn build_async_with_sleeper<S: Sleeper>( self, ) -> Result<AsyncClient<S>, Error>
Build an asynchronous client from builder where the returned client uses a
user-defined Sleeper
.