pub struct RTCDataChannelInit {
pub ordered: bool,
pub max_packet_life_time: Option<u16>,
pub max_retransmits: Option<u16>,
pub protocol: String,
pub negotiated: Option<StreamId>,
}Expand description
Dictionary for configuring properties of an RTCDataChannel.
The RTCDataChannelInit dictionary is used to configure the properties of a data channel
when creating it via RTCPeerConnection::create_data_channel.
§Specifications
§Examples
use rtc::data_channel::RTCDataChannelInit;
let init = RTCDataChannelInit {
ordered: false,
max_retransmits: Some(3),
..Default::default()
};Fields§
§ordered: boolIf set to false, data is allowed to be delivered out of order.
The default value of true guarantees that data will be delivered in order.
Setting this to false may improve latency at the cost of ordering guarantees.
Corresponds to the ordered attribute in the W3C specification.
max_packet_life_time: Option<u16>Limits the time (in milliseconds) during which the channel will transmit or retransmit data if not acknowledged.
If set, this value may be clamped to the maximum value supported by the user agent.
This option cannot be used together with max_retransmits.
Corresponds to the maxPacketLifeTime attribute in the W3C specification.
max_retransmits: Option<u16>Limits the number of times the channel will retransmit data if not successfully delivered.
If set, this value may be clamped to the maximum value supported by the user agent.
This option cannot be used together with max_packet_life_time.
Corresponds to the maxRetransmits attribute in the W3C specification.
protocol: StringThe name of the subprotocol used for this channel.
An empty string indicates no subprotocol is being used. The default is an empty string.
Corresponds to the protocol attribute in the W3C specification.
negotiated: Option<StreamId>If Some(id), the data channel is negotiated out-of-band with the given stream identifier.
When set to Some(id), the application is responsible for negotiating the channel and
creating a matching data channel with the same id on the remote peer. The data channel
will not be announced in-band.
When set to None (the default), the user agent will announce the channel in-band and
automatically create a corresponding data channel on the remote peer.
Corresponds to the negotiated and id attributes in the W3C specification.
Trait Implementations§
Source§impl Clone for RTCDataChannelInit
impl Clone for RTCDataChannelInit
Source§impl Default for RTCDataChannelInit
impl Default for RTCDataChannelInit
Source§fn default() -> Self
fn default() -> Self
The defaults defined by W3C RTCDataChannelInit.
Note ordered: it defaults to true, so ..Default::default() yields an ordered,
reliable channel — what an application asking for “a plain data channel” expects.
A derived Default would make it false, and an unordered channel does more than
reorder application messages: unordered chunks bypass SCTP’s ordered-delivery queue,
so a first message can overtake the DATA_CHANNEL_OPEN sent on the same stream and
be dropped by the peer as data on a stream it has not accepted yet.
Auto Trait Implementations§
impl Forget for RTCDataChannelInit
impl Freeze for RTCDataChannelInit
impl Move for RTCDataChannelInit
impl RefUnwindSafe for RTCDataChannelInit
impl Send for RTCDataChannelInitwhere
RawVecInner: Send,
impl Sync for RTCDataChannelInitwhere
RawVecInner: Sync,
impl Unpin for RTCDataChannelInit
impl UnsafeUnpin for RTCDataChannelInit
impl UnwindSafe for RTCDataChannelInitwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.