mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-18 04:21:22 +00:00
Pass the error to inject_listener_closed method (#1517)
* Pass the error to inject_listener_closed method If there is an error when the listener closes, found in the `NetworkEvent::ListenerClosed` `reason` field, we would like to pass it on to the `inject_listener_closed()` method so that implementors of this method have access to it. Add an error parameter to `inject_listener_closed`. Convert the `reason` field from a `Result` to an `Option` and if there is an error pass `Some(error)` at the method call site. * Pass 'reason' as a Result * Finish change Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@ -146,7 +146,7 @@ pub trait NetworkBehaviour: Send + 'static {
|
||||
}
|
||||
|
||||
/// A listener closed.
|
||||
fn inject_listener_closed(&mut self, _id: ListenerId) {
|
||||
fn inject_listener_closed(&mut self, _id: ListenerId, _reason: Result<(), &std::io::Error>) {
|
||||
}
|
||||
|
||||
/// Polls for things that swarm should do.
|
||||
@ -304,4 +304,3 @@ impl Default for DialPeerCondition {
|
||||
DialPeerCondition::Disconnected
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user