webrtc/data_channel/data_channel_init.rs
1/// DataChannelConfig can be used to configure properties of the underlying
2/// channel such as data reliability.
3///
4/// ## Specifications
5///
6/// * [W3C]
7///
8/// [W3C]: https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit
9#[derive(Default, Debug, Clone)]
10pub struct RTCDataChannelInit {
11 /// ordered indicates if data is allowed to be delivered out of order. The
12 /// default value of true, guarantees that data will be delivered in order.
13 pub ordered: Option<bool>,
14
15 /// max_packet_life_time limits the time (in milliseconds) during which the
16 /// channel will transmit or retransmit data if not acknowledged. This value
17 /// may be clamped if it exceeds the maximum value supported.
18 pub max_packet_life_time: Option<u16>,
19
20 /// max_retransmits limits the number of times a channel will retransmit data
21 /// if not successfully delivered. This value may be clamped if it exceeds
22 /// the maximum value supported.
23 pub max_retransmits: Option<u16>,
24
25 /// protocol describes the subprotocol name used for this channel.
26 pub protocol: Option<String>,
27
28 /// negotiated describes if the data channel is created by the local peer or
29 /// the remote peer. The default value of None tells the user agent to
30 /// announce the channel in-band and instruct the other peer to dispatch a
31 /// corresponding DataChannel. If set to Some(id), it is up to the application
32 /// to negotiate the channel and create an DataChannel with the same id
33 /// at the other peer.
34 pub negotiated: Option<u16>,
35}