Skip to content

Commit 9ca2925

Browse files
committed
docs
1 parent 3b98a39 commit 9ca2925

File tree

1 file changed

+29
-10
lines changed

1 file changed

+29
-10
lines changed

webrtc/src/lib.rs

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! [WebRTC for the Curious](https://webrtcforthecurious.com/) book is a free
1313
//! resource that provides a great introduction to the topic.
1414
//!
15-
//! ## Features
15+
//! # Features
1616
//!
1717
//! - Connections to remote peers using NAT-traversal technologies (STUN, TURN, and ICE)
1818
//! - Streaming of audio and video media via RTP and RTCP
@@ -22,7 +22,7 @@
2222
//! - Support for Multicast DNS (mDNS)
2323
//! - Interceptors for RTP, RTCP, and DataChannel packets
2424
//!
25-
//! ## Key Concepts
25+
//! # Key Concepts
2626
//!
2727
//! The WebRTC API, as defined by the W3C specification, is composed of a number of
2828
//! constructs and interfaces that provide a rich set of functionality, including
@@ -36,7 +36,7 @@
3636
//! The following section provides a brief overview of the key concepts and constructs
3737
//! that are used throughout the WebRTC API.
3838
//!
39-
//! ### RTCConfiguration
39+
//! ### Configuration
4040
//!
4141
//! The [`RTCConfiguration`] struct defines the set of parameters that are used to configure
4242
//! how peer-to-peer communication via [`RTCPeerConnection`] is established or re-established.
@@ -46,7 +46,7 @@
4646
//! Configurations may be reused across multiple [`RTCPeerConnection`]s, and are treated as read-only
4747
//! once constructed.
4848
//!
49-
//! ### RTCPeerConnection
49+
//! ### Peer Connections
5050
//!
5151
//! The [`RTCPeerConnection`] is the primary entry point to the WebRTC API. It represents an
5252
//! individual connection between a local device and a remote peer.
@@ -66,7 +66,7 @@
6666
//! passing a FnMut closure that accepts the corresponding enum type and returns a
6767
//! `Pin<Box<dyn Future<Output = ()> + Send + 'static>` future to be awaited.
6868
//!
69-
//! #### Sync vs. Async
69+
//! ### Event Handling
7070
//!
7171
//! For clarity, the event handler methods run synchronously and accept a (synchronous) closure
7272
//! that returns a future. Any async work that you need to do as part of an event handler should
@@ -80,7 +80,7 @@
8080
//!
8181
//! **This will be a common source of confusion for new users of the crate.**
8282
//!
83-
//! #### Session Descriptions
83+
//! ### Session Descriptions
8484
//!
8585
//! In the WebRTC protocol, session descriptions serve as the mechanism for exchanging
8686
//! information about media capabilities, network addresses, and other metadata between
@@ -95,7 +95,7 @@
9595
//! ([Session Description Protocol](https://en.wikipedia.org/wiki/Session_Description_Protocol))
9696
//! documents.
9797
//!
98-
//! #### Signaling
98+
//! ### Signaling
9999
//!
100100
//! In order to establish a connection, both peers must exchange their session descriptions
101101
//! with each other. The process of exchanging of session descriptions between peers is
@@ -136,6 +136,25 @@
136136
//! As signaling is an application-specific concern, this crate does not provide any
137137
//! built-in signaling functionality or guidance on how to implement.
138138
//!
139+
//! ### ICE Agent
140+
//!
141+
//! The [`Agent`](ice::agent::Agent) struct implements the ICE ([Interactive Connectivity Establishment](https://en.wikipedia.org/wiki/Interactive_Connectivity_Establishment))
142+
//! protocol, which is used to gather local ICE candidates, as well as manage the state of the
143+
//! ICE transport for a given peer connection.
144+
//!
145+
//! ICE agent's configuration parameters are defined by the [`RTCConfiguration`] struct.
146+
//!
147+
//! Certain [`RTCPeerConnection`] methods interact with the ICE agent, including:
148+
//!
149+
//! - [`add_ice_candidate()`](crate::peer_connection::RTCPeerConnection::add_ice_candidate)
150+
//! - [`set_local_description()`](crate::peer_connection::RTCPeerConnection::set_local_description)
151+
//! - [`set_remote_description()`](crate::peer_connection::RTCPeerConnection::set_remote_description)
152+
//! - [`close()`](crate::peer_connection::RTCPeerConnection::close)
153+
//!
154+
//! These interactions are described in [RFC8829](https://tools.ietf.org/html/rfc8829). The ICE
155+
//! agency also provides indications when the state of an ICE transport changes via the event
156+
//! handler methods that are available within [`RTCPeerConnection`].
157+
//!
139158
//! ### MediaStream
140159
//!
141160
//! ### DataChannel
@@ -144,18 +163,18 @@
144163
//!
145164
//! ### RTCSessionDescription
146165
//!
147-
//! ## Examples
166+
//! # Examples
148167
//!
149168
//! The `examples/` directory contains a range of examples, from basic peer connections to
150169
//! advanced data channel usage.
151170
//!
152-
//! ## Compatibility
171+
//! # Compatibility
153172
//!
154173
//! This crate aims to stay up-to-date with the latest W3C WebRTC specification. However,
155174
//! as WebRTC is a rapidly evolving standard, there might be minor discrepancies. Always
156175
//! refer to the official W3C WebRTC specification for authoritative information.
157176
//!
158-
//! ## License
177+
//! # License
159178
//!
160179
//! This project is licensed under either of the following, at your option:
161180
//! - [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)

0 commit comments

Comments
 (0)