@@ -117,20 +117,20 @@ pub struct Behaviour {
117117pub struct Config {
118118 /// Application-specific version of the protocol family used by the peer,
119119 /// e.g. `ipfs/1.0.0` or `polkadot/1.0.0`.
120- pub protocol_version : String ,
120+ protocol_version : String ,
121121 /// The public key of the local node. To report on the wire.
122- pub local_public_key : PublicKey ,
122+ local_public_key : PublicKey ,
123123 /// Name and version of the local peer implementation, similar to the
124124 /// `User-Agent` header in the HTTP protocol.
125125 ///
126126 /// Defaults to `rust-libp2p/<libp2p-identify-version>`.
127- pub agent_version : String ,
127+ agent_version : String ,
128128 /// The interval at which identification requests are sent to
129129 /// the remote on established connections after the first request,
130130 /// i.e. the delay between identification requests.
131131 ///
132132 /// Defaults to 5 minutes.
133- pub interval : Duration ,
133+ interval : Duration ,
134134
135135 /// Whether new or expired listen addresses of the local node should
136136 /// trigger an active push of an identify message to all connected peers.
@@ -140,19 +140,19 @@ pub struct Config {
140140 /// i.e. before the next periodic identify request with each peer.
141141 ///
142142 /// Disabled by default.
143- pub push_listen_addr_updates : bool ,
143+ push_listen_addr_updates : bool ,
144144
145145 /// How many entries of discovered peers to keep before we discard
146146 /// the least-recently used one.
147147 ///
148148 /// Disabled by default.
149- pub cache_size : usize ,
149+ cache_size : usize ,
150150
151151 /// Whether to include our listen addresses in our responses. If enabled,
152152 /// we will effectively only share our external addresses.
153153 ///
154154 /// Disabled by default.
155- pub hide_listen_addrs : bool ,
155+ hide_listen_addrs : bool ,
156156}
157157
158158impl Config {
@@ -202,6 +202,41 @@ impl Config {
202202 self . hide_listen_addrs = b;
203203 self
204204 }
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+ }
205240}
206241
207242impl Behaviour {
0 commit comments