pub async fn detach(&self) -> Result<Arc<data::data_channel::DataChannel>> {
        if !self.setting_engine.detach.data_channels {
            return Err(Error::ErrDetachNotEnabled);
        }

        let data_channel = self.data_channel.lock().await;
        if let Some(dc) = &*data_channel {
            self.detach_called.store(true, Ordering::SeqCst);

            Ok(Arc::clone(dc))
        } else {
            Err(Error::ErrDetachBeforeOpened)
        }
    }
/// detach allows you to detach the underlying datachannel. This provides
/// an idiomatic API to work with, however it disables the OnMessage callback.
/// Before calling Detach you have to enable this behavior by calling
/// webrtc.DetachDataChannels(). Combining detached and normal data channels
/// is not supported.
/// Please refer to the data-channels-detach example and the
/// pion/datachannel documentation for the correct way to handle the
/// resulting DataChannel object.
detach allows you to detach the underlying datachannel. This provides
an idiomatic API to work with, however it disables the OnMessage callback.
Before calling Detach you have to enable this behavior by calling
webrtc.DetachDataChannels(). Combining detached and normal data channels
is not supported.
Please refer to the data-channels-detach example and the
pion/datachannel documentation for the correct way to handle the
resulting DataChannel object.
detach allows you to detach the underlying datachannel . This provides an idiomatic API to work with however it disables the OnMessage callback . Before calling Detach you have to enable this behavior by calling webrtc . DetachDataChannels () . Combining detached and normal data channels is not supported . Please refer to the data - channels - detach example and the pion / datachannel documentation for the correct way to handle the resulting DataChannel object .
pub async fn detach(&self) -> Result<Arc<data::data_channel::DataChannel>> {
        if !self.setting_engine.detach.data_channels {
            return Err(Error::ErrDetachNotEnabled);
        }
        let data_channel = self.data_channel.lock().await;
        if let Some(dc) = &*data_channel {
            self.detach_called.store(true, Ordering::SeqCst);
            Ok(Arc::clone(dc))
        } else {
            Err(Error::ErrDetachBeforeOpened)
        }
    }
pub async fn detach ( & self ) -> Result < Arc < data :: data_channel :: DataChannel > > { if ! self . setting_engine . detach . data_channels { return Err ( Error :: ErrDetachNotEnabled ) ; } let data_channel = self . data_channel . lock ( ) . await ; if let Some ( dc ) = & * data_channel { self . detach_called . store ( true , Ordering :: SeqCst ) ; Ok ( Arc :: clone ( dc ) ) } else { Err ( Error :: ErrDetachBeforeOpened ) } }
detach allows you to detach the underlying datachannel.
detach allows you to detach the underlying datachannel .
&self