mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-20 21:36:31 +00:00
refactor(swarm)!: remove handler
from NetworkBehaviourAction::Dial
(#3328)
We create the `ConnectionId` for the new connection as part of `DialOpts`. This allows `NetworkBehaviour`s to accurately track state regarding their own dial attempts. This patch is the main enabler of https://github.com/libp2p/rust-libp2p/pull/3254. Removing the `handler` field will allow us to deprecate the `NetworkBehaviour::new_handler` function in favor of four new ones that give more control over the connection lifecycle.
This commit is contained in:
@ -13,6 +13,12 @@ pub struct StreamMuxerBox {
|
||||
inner: Pin<Box<dyn StreamMuxer<Substream = SubstreamBox, Error = io::Error> + Send>>,
|
||||
}
|
||||
|
||||
impl fmt::Debug for StreamMuxerBox {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("StreamMuxerBox").finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
/// Abstract type for asynchronous reading and writing.
|
||||
///
|
||||
/// A [`SubstreamBox`] erases the concrete type it is given and only retains its `AsyncRead`
|
||||
|
Reference in New Issue
Block a user