Browse Source

fixed session doc to work with inline tool

rachel-rose 5 years ago
parent
commit
698572e5cd

+ 4 - 4
src/net/sessions/inbound_session.rs

@@ -28,8 +28,8 @@ impl InboundSession {
             accept_task: StoppableTask::new(),
         })
     }
-    /// Starts the inbound session. Begins by accepting connections and fails if the address is not
-    /// configured. Then runs the channel subscription loop.
+    /// Starts the inbound session. Begins by accepting connections and fails if the
+    /// address is not configured. Then runs the channel subscription loop.
     pub fn start(self: Arc<Self>, executor: Arc<Executor<'_>>) -> NetResult<()> {
         match self.p2p().settings().inbound {
             Some(accept_addr) => {
@@ -84,8 +84,8 @@ impl InboundSession {
         }
     }
 
-    /// Registers the channel. First performs a network handshake and starts the channel. Then starts
-    /// sending keep-alive and address messages across the channel.
+    /// Registers the channel. First performs a network handshake and starts the
+    /// channel. Then starts sending keep-alive and address messages across the channel.
     async fn setup_channel(
         self: Arc<Self>,
         channel: ChannelPtr,

+ 8 - 8
src/net/sessions/outbound_session.rs

@@ -56,10 +56,10 @@ impl OutboundSession {
         }
     }
 
-    /// Start making outbound connections.
-    /// Creates a connector object, then starts a connect loop. Loads a valid address then tries to
-    /// connect. Once connected, registers the channel, removes it from the list of pending
-    /// channels, and starts sending messages across the channel. Otherwise returns a network error.
+    /// Start making outbound connections. Creates a connector object, then starts a
+    /// connect loop. Loads a valid address then tries to connect. Once connected,
+    /// registers the channel, removes it from the list of pending channels, and
+    /// starts sending messages across the channel. Otherwise returns a network error.
     pub async fn channel_connect_loop(
         self: Arc<Self>,
         slot_number: u32,
@@ -102,10 +102,10 @@ impl OutboundSession {
         }
     }
 
-    /// Loops through host addresses to find a outbound address that we can connect to.
-    /// Checks whether address is valid by making sure it isn't our own inbound address,
-    /// then checks whether it is already connected (exists) or connecting (pending).
-    /// Keeps looping until address is found that passes all checks.
+    /// Loops through host addresses to find a outbound address that we can connect
+    /// to. Checks whether address is valid by making sure it isn't our own inbound
+    /// address, then checks whether it is already connected (exists) or connecting
+    /// (pending). Keeps looping until address is found that passes all checks.
     async fn load_address(&self, slot_number: u32) -> NetResult<SocketAddr> {
         let p2p = self.p2p();
         let hosts = p2p.hosts();

+ 8 - 5
src/net/sessions/session.rs

@@ -25,10 +25,12 @@ async fn remove_sub_on_stop(p2p: P2pPtr, channel: ChannelPtr) {
 }
 
 #[async_trait]
-/// Session trait. Defines methods that are used across sessions. Implements registering the channel
-/// and initializing the channel by performing a network handshake.
+/// Session trait. Defines methods that are used across sessions. Implements
+/// registering the channel and initializing the channel by performing a network
+/// handshake.
 pub trait Session: Sync {
-    /// Registers a new channel with the session. Performs a network handshake and starts the channel.
+    /// Registers a new channel with the session. Performs a network handshake and
+    /// starts the channel.
     async fn register_channel(
         self: Arc<Self>,
         channel: ChannelPtr,
@@ -49,8 +51,9 @@ pub trait Session: Sync {
         Ok(())
     }
 
-    /// Performs network handshake to initialize channel. Adds the channel to the list of connected
-    /// channels, and prepares to remove the channel when a stop signal is received.
+    /// Performs network handshake to initialize channel. Adds the channel to the
+    /// list of connected channels, and prepares to remove the channel when a stop
+    /// signal is received.
     async fn perform_handshake_protocols(
         &self,
         protocol_version: Arc<ProtocolVersion>,