mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-08-01 01:11:58 +00:00
Allow StreamMuxer to notify changes in the address (#1621)
* Allow StreamMuxer to notify changes in the address * Fix doc link * Revert accidental rename * Other accidental rename Co-authored-by: Roman Borschel <romanb@users.noreply.github.com>
This commit is contained in:
@@ -155,6 +155,16 @@ where
|
||||
/// Event that was produced by the node.
|
||||
event: TOutEvent,
|
||||
},
|
||||
|
||||
/// An established connection has changed its address.
|
||||
AddressChange {
|
||||
/// The connection whose address has changed.
|
||||
connection: EstablishedConnection<'a, TInEvent, TConnInfo, TPeerId>,
|
||||
/// New endpoint of this connection.
|
||||
new_endpoint: ConnectedPoint,
|
||||
/// Old endpoint of this connection.
|
||||
old_endpoint: ConnectedPoint,
|
||||
},
|
||||
}
|
||||
|
||||
impl<TTrans, TInEvent, TOutEvent, THandler, TConnInfo, TPeerId> fmt::Debug for
|
||||
@@ -240,6 +250,13 @@ where
|
||||
.field("event", event)
|
||||
.finish()
|
||||
}
|
||||
NetworkEvent::AddressChange { connection, new_endpoint, old_endpoint } => {
|
||||
f.debug_struct("AddressChange")
|
||||
.field("connection", connection)
|
||||
.field("new_endpoint", new_endpoint)
|
||||
.field("old_endpoint", old_endpoint)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user