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

@ -296,7 +296,7 @@ where
> {
// Drain pending events.
if let Some(event) = self.pending_events.pop_front() {
return Poll::Ready(ConnectionHandlerEvent::Custom(event));
return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(event));
} else if self.pending_events.capacity() > EMPTY_QUEUE_SHRINK_THRESHOLD {
self.pending_events.shrink_to_fit();
}
@ -307,7 +307,7 @@ where
Ok(((id, rq), rs_sender)) => {
// We received an inbound request.
self.keep_alive = KeepAlive::Yes;
return Poll::Ready(ConnectionHandlerEvent::Custom(Event::Request {
return Poll::Ready(ConnectionHandlerEvent::NotifyBehaviour(Event::Request {
request_id: id,
request: rq,
sender: rs_sender,