From 78816ccb61b55d1e940f036634fed6f98bb84a10 Mon Sep 17 00:00:00 2001 From: rachel-rose Date: Mon, 5 Apr 2021 09:59:01 +0200 Subject: [PATCH] more verbose documentation edit on p2p.rs. summarizes interface utlities --- src/net/p2p.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/net/p2p.rs b/src/net/p2p.rs index 15a03fdb8..a2a9080dc 100644 --- a/src/net/p2p.rs +++ b/src/net/p2p.rs @@ -18,7 +18,12 @@ pub type ConnectedChannels = Mutex>>; /// Atomic pointer to p2p interface. pub type P2pPtr = Arc; -/// Top level peer-to-peer networking interface. +/// Top level peer-to-peer networking interface. Provides all core functionality +/// to interact with the peer-to-peer network. Used to create a network, to +/// start and run it, to broadcast messages across all channels, and to manage +/// the channel store. The channel store is a hashmap of channel address that we +/// can use to add and remove channels or check whether a channel is already is +/// in the store. pub struct P2p { pending: PendingChannels, channels: ConnectedChannels, @@ -137,7 +142,7 @@ impl P2p { self.channel_subscriber.clone().subscribe().await } - /// Stop a subscription. + /// Subscribe to a stop signal. pub async fn subscribe_stop(&self) -> Subscription { self.stop_subscriber.clone().subscribe().await }