Expand description
An extensible blocking/async Waterfalls client
This library provides an extensible blocking and async Waterfalls client to query Waterfalls’s backend.
The library provides the possibility to build a blocking
client using minreq and an async client using reqwest.
The library supports communicating to Waterfalls via a proxy
and also using TLS (SSL) for secure communication.
§Usage
You can create a blocking client as follows:
use waterfalls_client::Builder;
let builder = Builder::new("https://blockstream.info/testnet/api");
let blocking_client = builder.build_blocking();Here is an example of how to create an asynchronous client.
use waterfalls_client::Builder;
let builder = Builder::new("https://blockstream.info/testnet/api");
let async_client = builder.build_async();§Features
By default the library enables all features. To specify
specific features, set default-features to false in your Cargo.toml
and specify the features you want. This will look like this:
waterfalls-client = { version = "*", default-features = false, features = ["blocking"] }
blockingenablesminreq, the blocking client with proxy.blocking-httpsenablesminreq, the blocking client with proxy and TLS (SSL) capabilities using the defaultminreqbackend.blocking-https-rustlsenablesminreq, the blocking client with proxy and TLS (SSL) capabilities using therustlsbackend.blocking-https-nativeenablesminreq, the blocking client with proxy and TLS (SSL) capabilities using the platform’s native TLS backend (likely OpenSSL).blocking-https-bundledenablesminreq, the blocking client with proxy and TLS (SSL) capabilities using a bundled OpenSSL library backend.asyncenablesreqwest, the async client with proxy capabilities.async-httpsenablesreqwest, the async client with support for proxying and TLS (SSL) using the defaultreqwestTLS backend.async-https-nativeenablesreqwest, the async client with support for proxying and TLS (SSL) using the platform’s native TLS backend (likely OpenSSL).async-https-rustlsenablesreqwest, the async client with support for proxying and TLS (SSL) using therustlsTLS backend.async-https-rustls-manual-rootsenablesreqwest, the async client with support for proxying and TLS (SSL) using therustlsTLS backend without using its the default root certificates.
Re-exports§
pub use async::Sleeper;pub use blocking::BlockingClient;pub use async::AsyncClient;pub use api::*;
Modules§
Structs§
Enums§
- Error
- Errors that can happen during a request to
Waterfallsservers.
Constants§
- RETRYABLE_
ERROR_ CODES - Response status codes for which the request may be retried.