INNER CODE UNIT · Rust
send_text
webrtc-rs/webrtc · src/data_channel/mod.rs:180
async fn send_text(&self, text: &str) -> Result<()>;
/// Waits until this channel can accept more data — its outstanding send bytes are
/// below the configured send-buffer limit.
///
/// Resolves immediately when no limit is configured (the default) or the buffer is
/// already below it. Returns [`Error::ErrDataChannelClosed`] if the channel or
/// connection is closing. This is the await-for-capacity primitive that blocking
/// [`send`](Self::send) uses internally; call it directly to pace your own sends.
///
/// Level-triggered, not a reserved permit: with multiple concurrent senders on one
/// channel the limit is a soft bound (each admitted sender may add one in-flight
/// message over it) — the same semantics as `bufferedAmount`-based flow control.
///
/// Defaults to `Ok(())`; the built-in channel overrides it. This trait is sealed, so
/// the default exists for in-crate implementations, not downstream ones.
async fn writable(&self) -> Result<()> {
Ok(())
}