mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-29 17:51:35 +00:00
feat(swarm): rename Custom
variant to NotifyBehaviour
Rename `ConnectionHandlerEvent::Custom` to `ConnectionHandlerEvent::NotifyBehaviour`. Related #3848. Pull-Request: #3955.
This commit is contained in:
@ -174,13 +174,13 @@ impl Handler {
|
||||
future::Either::Left(remote_info) => {
|
||||
self.update_supported_protocols_for_remote(&remote_info);
|
||||
self.events
|
||||
.push(ConnectionHandlerEvent::Custom(Event::Identified(
|
||||
.push(ConnectionHandlerEvent::NotifyBehaviour(Event::Identified(
|
||||
remote_info,
|
||||
)));
|
||||
}
|
||||
future::Either::Right(()) => self
|
||||
.events
|
||||
.push(ConnectionHandlerEvent::Custom(Event::IdentificationPushed)),
|
||||
future::Either::Right(()) => self.events.push(ConnectionHandlerEvent::NotifyBehaviour(
|
||||
Event::IdentificationPushed,
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,10 +192,9 @@ impl Handler {
|
||||
>,
|
||||
) {
|
||||
let err = err.map_upgrade_err(|e| e.into_inner());
|
||||
self.events
|
||||
.push(ConnectionHandlerEvent::Custom(Event::IdentificationError(
|
||||
err,
|
||||
)));
|
||||
self.events.push(ConnectionHandlerEvent::NotifyBehaviour(
|
||||
Event::IdentificationError(err),
|
||||
));
|
||||
self.trigger_next_identify.reset(self.interval);
|
||||
}
|
||||
|
||||
@ -309,7 +308,9 @@ impl ConnectionHandler for Handler {
|
||||
|
||||
if let Ok(info) = res {
|
||||
self.update_supported_protocols_for_remote(&info);
|
||||
return Poll::Ready(ConnectionHandlerEvent::Custom(Event::Identified(info)));
|
||||
return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Event::Identified(
|
||||
info,
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -319,7 +320,7 @@ impl ConnectionHandler for Handler {
|
||||
.map(|()| Event::Identification)
|
||||
.unwrap_or_else(|err| Event::IdentificationError(StreamUpgradeError::Apply(err)));
|
||||
|
||||
return Poll::Ready(ConnectionHandlerEvent::Custom(event));
|
||||
return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event));
|
||||
}
|
||||
|
||||
Poll::Pending
|
||||
|
Reference in New Issue
Block a user