Skip to main content

rtc/data_channel/
message.rs

1use bytes::BytesMut;
2
3/// RTCDataChannelMessage represents a message received from the
4/// data channel. IsString will be set to true if the incoming
5/// message is of the string type. Otherwise, the message is of
6/// a binary type.
7#[derive(Default, Debug, Clone, Eq, PartialEq)]
8pub struct RTCDataChannelMessage {
9    /// Whether the message is a text message (UTF-8 encoded string).
10    pub is_string: bool,
11    /// The payload data of the message.
12    pub data: BytesMut,
13}