swarm/src/protocols_handler: Impl ProtocolsHandler on either::Either (#2192)

Implement ProtocolsHandler on either::Either representing either of two
ProtocolsHandler implementations.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
Max Inden
2021-08-17 18:02:06 +02:00
committed by GitHub
parent c58f697ef0
commit 49acf2eb5b
3 changed files with 312 additions and 2 deletions

View File

@ -38,6 +38,7 @@
//! > the network as a whole, see the `NetworkBehaviour` trait.
mod dummy;
pub mod either;
mod map_in;
mod map_out;
pub mod multi;
@ -45,7 +46,7 @@ mod node_handler;
mod one_shot;
mod select;
pub use crate::upgrade::{InboundUpgradeSend, OutboundUpgradeSend, UpgradeInfoSend};
pub use crate::upgrade::{InboundUpgradeSend, OutboundUpgradeSend, SendWrapper, UpgradeInfoSend};
use libp2p_core::{upgrade::UpgradeError, ConnectedPoint, Multiaddr, PeerId};
use std::{cmp::Ordering, error, fmt, task::Context, task::Poll, time::Duration};