diff options
-rw-r--r-- | src/shared/channel.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shared/channel.rs b/src/shared/channel.rs index 759e1b8..211f5a5 100644 --- a/src/shared/channel.rs +++ b/src/shared/channel.rs @@ -81,6 +81,20 @@ impl Channel { } } +pub(crate) fn get_channel_id_from_type<F>( + channel_type: ChannelType, + mut multi_id_generator: F, +) -> ChannelId +where + F: FnMut() -> MultiChannelId, +{ + match channel_type { + ChannelType::OrderedReliable => ChannelId::OrderedReliable(multi_id_generator()), + ChannelType::UnorderedReliable => ChannelId::UnorderedReliable, + ChannelType::Unreliable => ChannelId::Unreliable, + } +} + pub(crate) async fn ordered_reliable_channel_task( connection: quinn::Connection, _: mpsc::Sender<()>, |