1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Copyright 2026 Brainwires. MIT OR Apache-2.0.
//! The host around the sans-I/O [`rtci`] WebRTC engine: everything a
//! WebRTC implementation needs besides the protocol state machines and the
//! JavaScript bindings.
//!
//! `rtci` runs ICE, DTLS, SCTP, the data channels, SRTP and RTP as state
//! machines that never open a socket, arm a timer or read the clock. This
//! crate gives each [`Peer`] (one `RTCPeerConnection`) its sockets, timers,
//! STUN/TURN clients (UDP, TCP, TLS), ICE-TCP, mDNS, media packetizing and
//! frame assembly, the fake capture devices, and the queue of events for
//! the front end. It was extracted from the Denext-Deno fork's
//! `ext/webrtc`; the fork's built-in extension and the `rtci-ffi` library
//! are its two front ends.
//!
//! Two traits stand between the engine and the network:
//!
//! - [`NetGate`], the permission gate: every address the engine sends to,
//! every IP it binds on and the machine's interface list are asked of it
//! first. There is no allowing default ([`DenyAllGate`] refuses all). A
//! gate may answer later ([`AskGate`]): the engine holds back whatever
//! needed the answer, and [`Peer::set_remote_description`] /
//! [`Peer::add_ice_candidate`] finish through an `opdone` event
//! ([`JsEvent::OpDone`]).
//! - [`NetIo`], the socket factory: the only place sockets are created and
//! names resolved, each call carrying the [`GateToken`] of the allow it
//! needs. [`PlainNetIo`] uses the operating system's.
//!
//! # Threading
//!
//! The engine is single-threaded (`Rc` / `RefCell`). It spawns `!Send`
//! tasks on the current thread: run it on a current-thread tokio runtime
//! (as Deno does), or inside a [`tokio::task::LocalSet`].
// wpt100:hdrext
// wpt100:ice
pub use *;
pub use AskGate;
pub use GateRequest;
pub use NO_GATE_REGISTERED;
pub use CertificateStore;
pub use certificate_fingerprints;
pub use certificate_from_pem;
pub use certificate_to_pem;
pub use expires_ms;
pub use generate_certificate;
pub use Error;
pub use ErrorKind;
pub use Result;
pub use DEFAULT_ASK_TIMEOUT;
pub use DenyAllGate;
pub use Direction;
pub use GateToken;
pub use Host;
pub use LocalBoxFuture;
pub use NetGate;
pub use Proto;
pub use Reach;
pub use ReachKind;
pub use Verdict;
pub use IceEvent;
pub use IceTransport;
pub use engine_log_level;
pub use is_engine_log_target;
pub use set_engine_log_level;
pub use IceTimeoutsArg;
pub use MdnsMode;
pub use Network;
pub use NetworkArg;
pub use NetworkOptions;
pub use PortRangeArg;
pub use PublicAddress;
pub use SharedEndpoint;
pub use TcpEndpoint;
pub use NetIo;
pub use PlainNetIo;
pub use UdpOpts;
pub use mdns_socket;
pub use IceServerSpec;
pub use JsEvent;
pub use PairCandidate;
pub use Payload;
pub use Peer;
pub use PeerDescriptions;
pub use PeerOptions;
pub use SelectedPair;
pub use ServerTransport;
pub use epoch_fields_relative;
/// The media types the front ends pass and receive (transceivers, tracks,
/// codecs, capabilities, frames).
/// Whether the fake capture devices are on (`DENO_FAKE_MEDIA_DEVICES=1`).