feat(swarm): rename Custom variant to NotifyBehaviour

Rename `ConnectionHandlerEvent::Custom` to `ConnectionHandlerEvent::NotifyBehaviour`.

Related #3848.

Pull-Request: #3955.
This commit is contained in:
Thomas Coratger
2023-05-16 21:20:00 +02:00
committed by GitHub
parent fbd471cd79
commit 9f3c85164c
18 changed files with 221 additions and 175 deletions

View File

@ -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