Define a Poll trait as an adaptor on BlockSource
[rust-lightning] / lightning-block-sync / src / lib.rs
index b2315e907d25d6411c908950a13f6dabfb76a5e6..8a2f817cec115fcd481e7975e162914779fc64d9 100644 (file)
@@ -3,8 +3,31 @@
 //! Defines a [`BlockSource`] trait, which is an asynchronous interface for retrieving block headers
 //! and data.
 //!
+//! Enabling feature `rest-client` or `rpc-client` allows configuring the client to fetch blocks
+//! using Bitcoin Core's REST or RPC interface, respectively.
+//!
+//! Both features support either blocking I/O using `std::net::TcpStream` or, with feature `tokio`,
+//! non-blocking I/O using `tokio::net::TcpStream` from inside a Tokio runtime.
+//!
 //! [`BlockSource`]: trait.BlockSource.html
 
+#[cfg(any(feature = "rest-client", feature = "rpc-client"))]
+pub mod http;
+
+pub mod poll;
+
+#[cfg(feature = "rest-client")]
+pub mod rest;
+
+#[cfg(feature = "rpc-client")]
+pub mod rpc;
+
+#[cfg(any(feature = "rest-client", feature = "rpc-client"))]
+mod convert;
+
+#[cfg(any(feature = "rest-client", feature = "rpc-client"))]
+mod utils;
+
 use bitcoin::blockdata::block::{Block, BlockHeader};
 use bitcoin::hash_types::BlockHash;
 use bitcoin::util::uint::Uint256;