chanmgr: Introduce get_or_launch_internal

This is going to be useful in a moment.
This commit is contained in:
Ian Jackson 2022-07-12 13:04:45 +01:00
parent 61ab684f74
commit 3c23c2333a
1 changed files with 10 additions and 0 deletions

View File

@ -120,6 +120,16 @@ impl<CF: ChannelFactory> AbstractChanMgr<CF> {
&self,
ident: <<CF as ChannelFactory>::Channel as AbstractChannel>::Ident,
target: CF::BuildSpec,
) -> Result<(CF::Channel, ChanProvenance)> {
let chan = self.get_or_launch_internal(ident, target).await?;
Ok(chan)
}
/// Get a channel whose identity is `ident` - internal implementation
async fn get_or_launch_internal(
&self,
ident: <<CF as ChannelFactory>::Channel as AbstractChannel>::Ident,
target: CF::BuildSpec,
) -> Result<(CF::Channel, ChanProvenance)> {
use map::ChannelState::*;