tx5_connection/
config.rs

1use std::sync::Arc;
2
3/// The backend webrtc module to use.
4#[derive(Debug, Clone, Copy)]
5pub enum BackendModule {
6    /// Use the libdatachannel backend.
7    #[cfg(feature = "backend-libdatachannel")]
8    LibDataChannel,
9
10    /// Use the go pion backend.
11    #[cfg(feature = "backend-go-pion")]
12    GoPion,
13}
14
15impl Default for BackendModule {
16    #[allow(unreachable_code)]
17    fn default() -> Self {
18        #[cfg(feature = "backend-libdatachannel")]
19        return Self::LibDataChannel;
20        #[cfg(feature = "backend-go-pion")]
21        Self::GoPion
22    }
23}
24
25/// Tx5 connection hub config.
26#[derive(Default)]
27pub struct HubConfig {
28    /// The backend webrtc module to use.
29    pub backend_module: BackendModule,
30
31    /// The signal config to use.
32    pub signal_config: Arc<tx5_signal::SignalConfig>,
33
34    /// Test falling back by failing webrtc setup.
35    #[cfg(test)]
36    pub test_fail_webrtc: bool,
37}