@@ -117,20 +117,20 @@ pub struct Behaviour {
117
117
pub struct Config {
118
118
/// Application-specific version of the protocol family used by the peer,
119
119
/// e.g. `ipfs/1.0.0` or `polkadot/1.0.0`.
120
- pub protocol_version : String ,
120
+ protocol_version : String ,
121
121
/// The public key of the local node. To report on the wire.
122
- pub local_public_key : PublicKey ,
122
+ local_public_key : PublicKey ,
123
123
/// Name and version of the local peer implementation, similar to the
124
124
/// `User-Agent` header in the HTTP protocol.
125
125
///
126
126
/// Defaults to `rust-libp2p/<libp2p-identify-version>`.
127
- pub agent_version : String ,
127
+ agent_version : String ,
128
128
/// The interval at which identification requests are sent to
129
129
/// the remote on established connections after the first request,
130
130
/// i.e. the delay between identification requests.
131
131
///
132
132
/// Defaults to 5 minutes.
133
- pub interval : Duration ,
133
+ interval : Duration ,
134
134
135
135
/// Whether new or expired listen addresses of the local node should
136
136
/// trigger an active push of an identify message to all connected peers.
@@ -140,19 +140,19 @@ pub struct Config {
140
140
/// i.e. before the next periodic identify request with each peer.
141
141
///
142
142
/// Disabled by default.
143
- pub push_listen_addr_updates : bool ,
143
+ push_listen_addr_updates : bool ,
144
144
145
145
/// How many entries of discovered peers to keep before we discard
146
146
/// the least-recently used one.
147
147
///
148
148
/// Disabled by default.
149
- pub cache_size : usize ,
149
+ cache_size : usize ,
150
150
151
151
/// Whether to include our listen addresses in our responses. If enabled,
152
152
/// we will effectively only share our external addresses.
153
153
///
154
154
/// Disabled by default.
155
- pub hide_listen_addrs : bool ,
155
+ hide_listen_addrs : bool ,
156
156
}
157
157
158
158
impl Config {
@@ -202,6 +202,41 @@ impl Config {
202
202
self . hide_listen_addrs = b;
203
203
self
204
204
}
205
+
206
+ /// Get the protocol version of the Config.
207
+ pub fn protocol_version ( & self ) -> & str {
208
+ & self . protocol_version
209
+ }
210
+
211
+ /// Get the local public key of the Config.
212
+ pub fn local_public_key ( & self ) -> & PublicKey {
213
+ & self . local_public_key
214
+ }
215
+
216
+ /// Get the agent version of the Config.
217
+ pub fn agent_version ( & self ) -> & str {
218
+ & self . agent_version
219
+ }
220
+
221
+ /// Get the interval of the Config.
222
+ pub fn interval ( & self ) -> Duration {
223
+ self . interval
224
+ }
225
+
226
+ /// Get the push listen address updates boolean value of the Config.
227
+ pub fn push_listen_addr_updates ( & self ) -> bool {
228
+ self . push_listen_addr_updates
229
+ }
230
+
231
+ /// Get the cache size of the Config.
232
+ pub fn cache_size ( & self ) -> usize {
233
+ self . cache_size
234
+ }
235
+
236
+ /// Get the hide listen address boolean value of the Config.
237
+ pub fn hide_listen_addrs ( & self ) -> bool {
238
+ self . hide_listen_addrs
239
+ }
205
240
}
206
241
207
242
impl Behaviour {
0 commit comments