5252//! capabilities using the platform's native TLS backend (likely OpenSSL).
5353//! * `blocking-https-bundled` enables [`minreq`], the blocking client with proxy and TLS (SSL)
5454//! capabilities using a bundled OpenSSL library backend.
55+ //!
5556//! * `async` enables [`reqwest`], the async client with proxy capabilities.
5657//! * `async-https` enables [`reqwest`], the async client with support for proxying and TLS (SSL)
5758//! using the default [`reqwest`] TLS backend.
@@ -71,8 +72,6 @@ use std::collections::HashMap;
7172use std:: fmt;
7273use std:: num:: TryFromIntError ;
7374
74- use bitcoin:: consensus;
75-
7675pub mod api;
7776
7877#[ cfg( feature = "async" ) ]
@@ -103,6 +102,7 @@ pub fn convert_fee_rate(target: usize, estimates: HashMap<u16, f64>) -> Result<f
103102
104103#[ derive( Debug , Clone ) ]
105104pub struct Builder {
105+ /// The URL of the Esplora server.
106106 pub base_url : String ,
107107 /// Optional URL of the proxy to use to make requests to the Esplora server
108108 ///
@@ -117,7 +117,7 @@ pub struct Builder {
117117 pub proxy : Option < String > ,
118118 /// Socket timeout.
119119 pub timeout : Option < u64 > ,
120- /// HTTP headers to set on every request made to Esplora server
120+ /// HTTP headers to set on every request made to Esplora server.
121121 pub headers : HashMap < String , String > ,
122122}
123123
@@ -150,20 +150,20 @@ impl Builder {
150150 self
151151 }
152152
153- /// build a blocking client from builder
153+ /// Build a blocking client from builder
154154 #[ cfg( feature = "blocking" ) ]
155155 pub fn build_blocking ( self ) -> BlockingClient {
156156 BlockingClient :: from_builder ( self )
157157 }
158158
159- // build an asynchronous client from builder
159+ // Build an asynchronous client from builder
160160 #[ cfg( feature = "async" ) ]
161161 pub fn build_async ( self ) -> Result < AsyncClient , Error > {
162162 AsyncClient :: from_builder ( self )
163163 }
164164}
165165
166- /// Errors that can happen during a sync with `Esplora`
166+ /// Errors that can happen during a request to `Esplora` servers.
167167#[ derive( Debug ) ]
168168pub enum Error {
169169 /// Error during `minreq` HTTP request
@@ -186,9 +186,9 @@ pub enum Error {
186186 HexToBytes ( bitcoin:: hex:: HexToBytesError ) ,
187187 /// Transaction not found
188188 TransactionNotFound ( Txid ) ,
189- /// Header height not found
189+ /// Block Header height not found
190190 HeaderHeightNotFound ( u32 ) ,
191- /// Header hash not found
191+ /// Block Header hash not found
192192 HeaderHashNotFound ( BlockHash ) ,
193193 /// Invalid HTTP Header name specified
194194 InvalidHttpHeaderName ( String ) ,
@@ -221,7 +221,7 @@ impl_error!(::minreq::Error, Minreq, Error);
221221#[ cfg( feature = "async" ) ]
222222impl_error ! ( :: reqwest:: Error , Reqwest , Error ) ;
223223impl_error ! ( std:: num:: ParseIntError , Parsing , Error ) ;
224- impl_error ! ( consensus:: encode:: Error , BitcoinEncoding , Error ) ;
224+ impl_error ! ( bitcoin :: consensus:: encode:: Error , BitcoinEncoding , Error ) ;
225225impl_error ! ( bitcoin:: hex:: HexToArrayError , HexToArray , Error ) ;
226226impl_error ! ( bitcoin:: hex:: HexToBytesError , HexToBytes , Error ) ;
227227
0 commit comments