Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit 23fda6e

Browse files
committed
doc: add missing docs for Swarm
1 parent 56ea9e3 commit 23fda6e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/p2p/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ mod transport;
1717
pub use addr::{MultiaddrWithPeerId, MultiaddrWithoutPeerId};
1818
pub use {behaviour::KadResult, swarm::Connection};
1919

20+
/// An IPFS swarm.
2021
pub type TSwarm<T> = Swarm<behaviour::Behaviour<T>>;
2122

23+
/// Defines the configuration for an IPFS swarm.
2224
pub struct SwarmOptions {
25+
/// The keypair for the PKI based identity of the local node.
2326
pub keypair: Keypair,
27+
/// The peer address of the local node created from the keypair.
2428
pub peer_id: PeerId,
29+
/// The peers to connect to on startup.
2530
pub bootstrap: Vec<(Multiaddr, PeerId)>,
31+
/// Enables mdns for peer discovery and announcement when true.
2632
pub mdns: bool,
33+
/// Custom Kademlia protocol name.
2734
pub kad_protocol: Option<String>,
2835
}
2936

src/p2p/swarm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::time::Duration;
1515
pub struct Connection {
1616
/// The connected peer along with its address.
1717
pub addr: MultiaddrWithPeerId,
18-
/// Latest ping report on any of the connections
18+
/// Latest ping report on any of the connections.
1919
pub rtt: Option<Duration>,
2020
}
2121

0 commit comments

Comments
 (0)