INNER CODE UNIT · Rust

try_send_text

webrtc-rs/webrtc · src/data_channel/mod.rs:213

    async fn try_send_text(&self, text: &str) -> Result<()> {
        self.send_text(text).await
    }
    /// Polls for the next event on this data channel.
    ///
    /// Resolves when the next [`DataChannelEvent`] is available, and returns `None` once the
    /// channel is closed and no events remain — so a `while let Some(event) = dc.poll().await`
    /// loop terminates on its own.
    async fn poll(&self) -> Option<DataChannelEvent>;
    /// Closes the data channel.
    ///
    /// Moves the channel to `Closing` and starts the DCEP/SCTP teardown; closing an
    /// already-closed channel succeeds. Senders blocked in [`send`](Self::send) or
    /// [`writable`](Self::writable) awaiting capacity are woken with
    /// [`Error::ErrDataChannelClosed`].
    async fn close(&self) -> Result<()>;
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…