@@ -67,7 +67,7 @@ pub enum UpgradeError {
67
67
68
68
pub struct Behaviour {
69
69
/// Queue of actions to return when polled.
70
- queued_actions : VecDeque < Action > ,
70
+ queued_actions : VecDeque < ActionBuilder > ,
71
71
72
72
/// All direct (non-relayed) connections.
73
73
direct_connections : HashMap < PeerId , HashSet < ConnectionId > > ,
@@ -113,7 +113,7 @@ impl NetworkBehaviour for Behaviour {
113
113
//
114
114
// https://github.com/libp2p/specs/blob/master/relay/DCUtR.md#the-protocol
115
115
self . queued_actions . extend ( [
116
- Action :: Connect {
116
+ ActionBuilder :: Connect {
117
117
peer_id : * peer_id,
118
118
attempt : 1 ,
119
119
handler : NotifyHandler :: One ( * connection_id) ,
@@ -152,7 +152,7 @@ impl NetworkBehaviour for Behaviour {
152
152
let peer_id =
153
153
peer_id. expect ( "Peer of `Prototype::DirectConnection` is always known." ) ;
154
154
if attempt < MAX_NUMBER_OF_UPGRADE_ATTEMPTS {
155
- self . queued_actions . push_back ( Action :: Connect {
155
+ self . queued_actions . push_back ( ActionBuilder :: Connect {
156
156
peer_id,
157
157
handler : NotifyHandler :: One ( relayed_connection_id) ,
158
158
attempt : attempt + 1 ,
@@ -219,7 +219,7 @@ impl NetworkBehaviour for Behaviour {
219
219
remote_addr,
220
220
} ) => {
221
221
self . queued_actions . extend ( [
222
- Action :: AcceptInboundConnect {
222
+ ActionBuilder :: AcceptInboundConnect {
223
223
peer_id : event_source,
224
224
handler : NotifyHandler :: One ( connection) ,
225
225
inbound_connect,
@@ -327,7 +327,7 @@ impl NetworkBehaviour for Behaviour {
327
327
/// A [`NetworkBehaviourAction`], either complete, or still requiring data from [`PollParameters`]
328
328
/// before being returned in [`Behaviour::poll`].
329
329
#[ allow( clippy:: large_enum_variant) ]
330
- enum Action {
330
+ enum ActionBuilder {
331
331
Done ( NetworkBehaviourAction < Event , handler:: Prototype > ) ,
332
332
Connect {
333
333
attempt : u8 ,
@@ -341,13 +341,13 @@ enum Action {
341
341
} ,
342
342
}
343
343
344
- impl From < NetworkBehaviourAction < Event , handler:: Prototype > > for Action {
344
+ impl From < NetworkBehaviourAction < Event , handler:: Prototype > > for ActionBuilder {
345
345
fn from ( action : NetworkBehaviourAction < Event , handler:: Prototype > ) -> Self {
346
346
Self :: Done ( action)
347
347
}
348
348
}
349
349
350
- impl Action {
350
+ impl ActionBuilder {
351
351
fn build (
352
352
self ,
353
353
poll_parameters : & mut impl PollParameters ,
@@ -364,8 +364,8 @@ impl Action {
364
364
} ;
365
365
366
366
match self {
367
- Action :: Done ( action) => action,
368
- Action :: AcceptInboundConnect {
367
+ ActionBuilder :: Done ( action) => action,
368
+ ActionBuilder :: AcceptInboundConnect {
369
369
inbound_connect,
370
370
handler,
371
371
peer_id,
@@ -377,7 +377,7 @@ impl Action {
377
377
obs_addrs : obs_addrs ( ) ,
378
378
} ) ,
379
379
} ,
380
- Action :: Connect {
380
+ ActionBuilder :: Connect {
381
381
attempt,
382
382
handler,
383
383
peer_id,
0 commit comments