Skip to content

Commit

Permalink
webrtc: Add spec links to public items
Browse files Browse the repository at this point in the history
  • Loading branch information
Serial-ATA committed Jul 1, 2024
1 parent cbb4149 commit 8058a72
Show file tree
Hide file tree
Showing 31 changed files with 226 additions and 2 deletions.
6 changes: 6 additions & 0 deletions webrtc/src/data_channel/data_channel_init.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
/// DataChannelConfig can be used to configure properties of the underlying
/// channel such as data reliability.
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelinit
#[derive(Default, Debug, Clone)]
pub struct RTCDataChannelInit {
/// ordered indicates if data is allowed to be delivered out of order. The
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/data_channel/data_channel_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ use std::fmt;
use serde::{Deserialize, Serialize};

/// DataChannelState indicates the state of a data channel.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel/readyState
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtcdatachannelstate
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum RTCDataChannelState {
#[serde(rename = "unspecified")]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/data_channel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ pub type OnCloseHdlrFn =
/// DataChannel represents a WebRTC DataChannel
/// The DataChannel interface represents a network channel
/// which can be used for bidirectional peer-to-peer transfers of arbitrary data
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtcdatachannel
#[derive(Default)]
pub struct RTCDataChannel {
pub(crate) stats_id: String,
Expand Down
9 changes: 8 additions & 1 deletion webrtc/src/dtls_transport/dtls_fingerprint.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
use serde::{Deserialize, Serialize};

/// DTLSFingerprint specifies the hash function algorithm and certificate
/// fingerprint as described in <https://tools.ietf.org/html/rfc4572>.
/// fingerprint as described in [RFC 4572].
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtcdtlsfingerprint
/// [RFC 4572]: https://tools.ietf.org/html/rfc4572
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct RTCDtlsFingerprint {
/// Algorithm specifies one of the the hash function algorithms defined in
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/dtls_transport/dtls_transport_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
use std::fmt;

/// DTLSTransportState indicates the DTLS transport establishment state.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCDtlsTransport/state
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtcdtlstransportstate
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum RTCDtlsTransportState {
#[default]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/ice_transport/ice_candidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ use crate::ice_transport::ice_candidate_type::RTCIceCandidateType;
use crate::ice_transport::ice_protocol::RTCIceProtocol;

/// ICECandidate represents a ice candidate
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RTCIceCandidate {
pub stats_id: String,
Expand Down
6 changes: 6 additions & 0 deletions webrtc/src/ice_transport/ice_candidate_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ use std::fmt;
use crate::ice_transport::ice_candidate::*;

/// ICECandidatePair represents an ICE Candidate pair
///
/// ## Specifications
///
/// * [MDN]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidatePair
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct RTCIceCandidatePair {
stats_id: String,
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/ice_transport/ice_candidate_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ use ice::candidate::CandidateType;
use serde::{Deserialize, Serialize};

/// ICECandidateType represents the type of the ICE candidate used.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidateStats/candidateType
/// [w3c]: https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatestats-candidatetype
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum RTCIceCandidateType {
#[default]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/ice_transport/ice_connection_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
use std::fmt;

/// RTCIceConnectionState indicates signaling state of the ICE Connection.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/iceConnectionState
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-peerconnection-ice-connection-state
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum RTCIceConnectionState {
#[default]
Expand Down
6 changes: 6 additions & 0 deletions webrtc/src/ice_transport/ice_gatherer_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
use std::fmt;

/// ICEGathererState represents the current state of the ICE gatherer.
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtcicegathererstate
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum RTCIceGathererState {
#[default]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/ice_transport/ice_gathering_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
use std::fmt;

/// ICEGatheringState describes the state of the candidate gathering process.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/iceGatheringState
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-peerconnection-ice-gathering-state
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum RTCIceGatheringState {
#[default]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/ice_transport/ice_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ use serde::{Deserialize, Serialize};

/// ICEParameters includes the ICE username fragment
/// and password and other ICE-related parameters.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceParameters
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtciceparameters
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RTCIceParameters {
pub username_fragment: String,
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/ice_transport/ice_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ use serde::{Deserialize, Serialize};

/// ICEProtocol indicates the transport protocol type that is used in the
/// ice.URL structure.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/protocol
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtciceprotocol-enum
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum RTCIceProtocol {
#[default]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/ice_transport/ice_role.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ use std::fmt;

/// ICERole describes the role ice.Agent is playing in selecting the
/// preferred the candidate pair.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceTransport/role
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtcicerole
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum RTCIceRole {
#[default]
Expand Down
6 changes: 6 additions & 0 deletions webrtc/src/ice_transport/ice_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ use crate::error::{Error, Result};

/// ICEServer describes a single STUN and TURN server that can be used by
/// the ICEAgent to establish a connection with a peer.
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtciceserver
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, Hash)]
pub struct RTCIceServer {
pub urls: Vec<String>,
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/ice_transport/ice_transport_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ use std::fmt;
use ice::state::ConnectionState;

/// ICETransportState represents the current state of the ICE transport.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceTransport/state
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtcicetransportstate
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum RTCIceTransportState {
#[default]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/peer_connection/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ use crate::stats::stats_collector::StatsCollector;
use crate::stats::{CertificateStats, StatsReportType};

/// Certificate represents a X.509 certificate used to authenticate WebRTC communications.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCCertificate
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtccertificate
#[derive(Clone, Debug)]
pub struct RTCCertificate {
/// DTLS certificate.
Expand Down
6 changes: 6 additions & 0 deletions webrtc/src/peer_connection/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ use crate::peer_connection::policy::rtcp_mux_policy::RTCRtcpMuxPolicy;
/// Configurations may be set up once and reused across multiple connections.
/// Configurations are treated as readonly. As long as they are unmodified,
/// they are safe for concurrent use.
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtcconfiguration-dictionary
#[derive(Default, Clone)]
pub struct RTCConfiguration {
/// iceservers defines a slice describing servers available to be used by
Expand Down
6 changes: 6 additions & 0 deletions webrtc/src/peer_connection/offer_answer_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ pub struct RTCAnswerOptions {

/// OfferOptions structure describes the options used to control the offer
/// creation process
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#dictionary-rtcofferoptions-members
#[derive(Default, Debug, PartialEq, Eq, Copy, Clone)]
pub struct RTCOfferOptions {
/// voice_activity_detection allows the application to provide information
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/peer_connection/peer_connection_state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
use std::fmt;

/// PeerConnectionState indicates the state of the PeerConnection.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/connectionState
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-peerconnection-connection-state
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum RTCPeerConnectionState {
#[default]
Expand Down
6 changes: 6 additions & 0 deletions webrtc/src/peer_connection/policy/bundle_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ use serde::{Deserialize, Serialize};
/// endpoint is not bundle-aware, and what ICE candidates are gathered. If the
/// remote endpoint is bundle-aware, all media tracks and data channels are
/// bundled onto the same transport.
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtcbundlepolicy-enum
#[derive(Default, Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
pub enum RTCBundlePolicy {
#[default]
Expand Down
6 changes: 6 additions & 0 deletions webrtc/src/peer_connection/policy/ice_transport_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ use serde::{Deserialize, Serialize};

/// ICETransportPolicy defines the ICE candidate policy surface the
/// permitted candidates. Only these candidates are used for connectivity checks.
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtcicetransportpolicy-enum
#[derive(Default, Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
pub enum RTCIceTransportPolicy {
#[default]
Expand Down
6 changes: 6 additions & 0 deletions webrtc/src/peer_connection/policy/rtcp_mux_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ use serde::{Deserialize, Serialize};

/// RTCPMuxPolicy affects what ICE candidates are gathered to support
/// non-multiplexed RTCP.
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtcrtcpmuxpolicy-enum
#[derive(Default, Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
pub enum RTCRtcpMuxPolicy {
#[default]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/peer_connection/sdp/sdp_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ use std::fmt;
use serde::{Deserialize, Serialize};

/// SDPType describes the type of an SessionDescription.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription/type
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-rtcsessiondescription-type
#[derive(Default, Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
pub enum RTCSdpType {
#[default]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/peer_connection/sdp/session_description.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ use super::sdp_type::RTCSdpType;
use crate::error::Result;

/// SessionDescription is used to expose local and remote session descriptions.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription
/// [w3c]: https://w3c.github.io/webrtc-pc/#rtcsessiondescription-class
#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct RTCSessionDescription {
#[serde(rename = "type")]
Expand Down
8 changes: 8 additions & 0 deletions webrtc/src/peer_connection/signaling_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ impl fmt::Display for StateChangeOp {
}

/// SignalingState indicates the signaling state of the offer/answer process.
///
/// ## Specifications
///
/// * [MDN]
/// * [w3c]
///
/// [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/signalingState
/// [w3c]: https://w3c.github.io/webrtc-pc/#dom-peerconnection-signaling-state
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
pub enum RTCSignalingState {
#[default]
Expand Down
7 changes: 6 additions & 1 deletion webrtc/src/rtp_transceiver/rtp_codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ impl fmt::Display for RTPCodecType {
}

/// RTPCodecCapability provides information about codec capabilities.
/// <https://w3c.github.io/webrtc-pc/#dictionary-rtcrtpcodeccapability-members>
///
/// ## Specifications
///
/// * [w3c]
///
/// [w3c]: https://w3c.github.io/webrtc-pc/#dictionary-rtcrtpcodeccapability-members
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct RTCRtpCodecCapability {
pub mime_type: String,
Expand Down
Loading

0 comments on commit 8058a72

Please sign in to comment.