scatter_net/scatter_net/peer_group/inner/config/
mod.rs

1use iroh::NodeId;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Debug, Default, Hash, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
5pub struct PeerGroupConfig {
6    #[serde(default = "default_name")]
7    pub name: String,
8
9    /// `Peer`s in this `PeerGroup`
10    pub members: Vec<NodeId>,
11
12    /// Add `Peer`s to this `PeerGroup` automatically?
13    pub open: bool,
14
15    /// `Peer`s will be added into this `PeerGroup` if the round-trip ping time
16    /// to the `Peer` falls under `rtt_cap_ms`.
17    ///
18    /// `Peer`s will not be added if this `PeerGroup` isn't `open`.
19    pub rtt_cap_ms: u64,
20}
21
22fn default_name() -> String {
23    "unnamed_peer_group".to_string()
24}