mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-02 11:11:36 +00:00
Add IntoProtocolsHandler::inbound_protocol
. (#1099)
This commit is contained in:
committed by
Pierre Krieger
parent
61b236172b
commit
fd0e48bf37
@ -161,6 +161,14 @@ where
|
||||
inner: self.inner.map(|h| h.into_handler(remote_peer_id))
|
||||
}
|
||||
}
|
||||
|
||||
fn inbound_protocol(&self) -> <Self::Handler as ProtocolsHandler>::InboundProtocol {
|
||||
if let Some(inner) = self.inner.as_ref() {
|
||||
EitherUpgrade::A(inner.inbound_protocol())
|
||||
} else {
|
||||
EitherUpgrade::B(DeniedUpgrade)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Implementation of `ProtocolsHandler` that can be in the disabled state.
|
||||
|
Reference in New Issue
Block a user