X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-block-sync%2Fsrc%2Flib.rs;h=823cb5eb554e2e9a0525004f4c84550adb9ab2a7;hb=3f3335ac487025d0251366478b8301f65a5e8d8b;hp=ac031132a71946f8706954d49138ff3f7b1e574e;hpb=affefb677e3f9f1a586707484ac82b6c86f4f26b;p=rust-lightning diff --git a/lightning-block-sync/src/lib.rs b/lightning-block-sync/src/lib.rs index ac031132..823cb5eb 100644 --- a/lightning-block-sync/src/lib.rs +++ b/lightning-block-sync/src/lib.rs @@ -13,10 +13,15 @@ //! 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. +// Prefix these with `rustdoc::` when we update our MSRV to be >= 1.52 to remove warnings. #![deny(broken_intra_doc_links)] +#![deny(private_intra_doc_links)] + #![deny(missing_docs)] #![deny(unsafe_code)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + #[cfg(any(feature = "rest-client", feature = "rpc-client"))] pub mod http; @@ -59,11 +64,11 @@ pub trait BlockSource : Sync + Send { /// /// Implementations that cannot find headers based on the hash should return a `Transient` error /// when `height_hint` is `None`. - fn get_header<'a>(&'a mut self, header_hash: &'a BlockHash, height_hint: Option) -> AsyncBlockSourceResult<'a, BlockHeaderData>; + fn get_header<'a>(&'a self, header_hash: &'a BlockHash, height_hint: Option) -> AsyncBlockSourceResult<'a, BlockHeaderData>; /// Returns the block for a given hash. A headers-only block source should return a `Transient` /// error. - fn get_block<'a>(&'a mut self, header_hash: &'a BlockHash) -> AsyncBlockSourceResult<'a, Block>; + fn get_block<'a>(&'a self, header_hash: &'a BlockHash) -> AsyncBlockSourceResult<'a, Block>; /// Returns the hash of the best block and, optionally, its height. /// @@ -71,7 +76,7 @@ pub trait BlockSource : Sync + Send { /// to allow for a more efficient lookup. /// /// [`get_header`]: Self::get_header - fn get_best_block<'a>(&'a mut self) -> AsyncBlockSourceResult<(BlockHash, Option)>; + fn get_best_block<'a>(&'a self) -> AsyncBlockSourceResult<(BlockHash, Option)>; } /// Result type for `BlockSource` requests.