Add comments to get rid of missing_docs warnings (#1032)

This commit is contained in:
Casey Rodarmor 2018-05-03 08:57:35 -04:00 committed by Antioch Peverell
parent bc3b8b1664
commit a481c6d495

View file

@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//! Adapters connecting new block, new transaction, and accepted transaction
//! events to consumers of those events.
use std::fs::File; use std::fs::File;
use std::net::SocketAddr; use std::net::SocketAddr;
use std::ops::Deref; use std::ops::Deref;
@ -348,6 +351,8 @@ impl p2p::ChainAdapter for NetToChainAdapter {
} }
impl NetToChainAdapter { impl NetToChainAdapter {
/// Construct a new NetToChainAdapter instance
pub fn new( pub fn new(
currently_syncing: Arc<AtomicBool>, currently_syncing: Arc<AtomicBool>,
chain_ref: Weak<chain::Chain>, chain_ref: Weak<chain::Chain>,
@ -363,6 +368,8 @@ impl NetToChainAdapter {
} }
} }
/// Initialize a NetToChainAdaptor with reference to a Peers object.
/// Should only be called once.
pub fn init(&self, peers: Weak<p2p::Peers>) { pub fn init(&self, peers: Weak<p2p::Peers>) {
self.peers.init(peers); self.peers.init(peers);
} }
@ -592,6 +599,8 @@ impl ChainAdapter for ChainToPoolAndNetAdapter {
} }
impl ChainToPoolAndNetAdapter { impl ChainToPoolAndNetAdapter {
/// Construct a ChainToPoolAndNetAdaper instance.
pub fn new( pub fn new(
tx_pool: Arc<RwLock<pool::TransactionPool<PoolToChainAdapter>>>, tx_pool: Arc<RwLock<pool::TransactionPool<PoolToChainAdapter>>>,
) -> ChainToPoolAndNetAdapter { ) -> ChainToPoolAndNetAdapter {
@ -600,6 +609,9 @@ impl ChainToPoolAndNetAdapter {
peers: OneTime::new(), peers: OneTime::new(),
} }
} }
/// Initialize a ChainToPoolAndNetAdapter instance with hanlde to a Peers object.
/// Should only be called once.
pub fn init(&self, peers: Weak<p2p::Peers>) { pub fn init(&self, peers: Weak<p2p::Peers>) {
self.peers.init(peers); self.peers.init(peers);
} }
@ -650,6 +662,7 @@ impl PoolToChainAdapter {
} }
} }
/// Set the pool adapter's chain. Should only be called once.
pub fn set_chain(&self, chain_ref: Weak<chain::Chain>) { pub fn set_chain(&self, chain_ref: Weak<chain::Chain>) {
self.chain.init(chain_ref); self.chain.init(chain_ref);
} }