pub trait DataChannelExt: Send {
// Required methods
fn wait_ready(&self) -> impl Future<Output = ()> + Send;
fn receive(&self) -> impl Future<Output = Result<Bytes, Error>> + Send;
fn send(
&self,
data: &Bytes,
) -> impl Future<Output = Result<usize, Error>> + Send;
fn id(&self) -> u16;
fn label(&self) -> String;
}
Expand description
Platform agnostic WebRTC DataChannel API
Required Methods§
Sourcefn wait_ready(&self) -> impl Future<Output = ()> + Send
fn wait_ready(&self) -> impl Future<Output = ()> + Send
Wait for the data channel to become open and ready to transfer data
Sourcefn receive(&self) -> impl Future<Output = Result<Bytes, Error>> + Send
fn receive(&self) -> impl Future<Output = Result<Bytes, Error>> + Send
Receive data from the channel
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.