Trait DataChannelExt

Source
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§

Source

fn wait_ready(&self) -> impl Future<Output = ()> + Send

Wait for the data channel to become open and ready to transfer data

Source

fn receive(&self) -> impl Future<Output = Result<Bytes, Error>> + Send

Receive data from the channel

Source

fn send( &self, data: &Bytes, ) -> impl Future<Output = Result<usize, Error>> + Send

Send data to the channel

Source

fn id(&self) -> u16

Get the unique ID of the channel

Source

fn label(&self) -> String

Get the assigned label of 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.

Implementors§