Add IntoProtocolsHandler::inbound_protocol. (#1099)

This commit is contained in:
Toralf Wittner
2019-05-08 20:23:28 +02:00
committed by Pierre Krieger
parent 61b236172b
commit fd0e48bf37
4 changed files with 20 additions and 6 deletions

View File

@ -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.