Skip to main content

RTCPeerConnection

Struct RTCPeerConnection 

Source
pub struct RTCPeerConnection { /* private fields */ }
Expand description

The RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it’s no longer needed.

This is a sans-I/O implementation following the W3C WebRTC specification.

§Driving the connection

This type performs no I/O and reads no clock. It never opens a socket, never sleeps, and never calls Instant::now() on your behalf: every method that needs the time takes it as an argument. Progress happens only when you feed it something. That is what makes a whole session reproducible in a test with no socket and no sleep.

The driving methods come from the sansio::Protocol trait, so the trait must be in scope (use rtc::sansio::Protocol;) or none of them will resolve:

MethodDirectionWhat it does
handle_readinFeed one received datagram, tagged with its 5-tuple and arrival instant
poll_writeoutTake the next packet to put on the wire; drain until None
poll_readoutTake the next inbound RTP/RTCP/data-channel message for the application
poll_eventoutTake the next state change or notification
poll_timeoutoutNext deadline for retransmissions, keepalives and ICE checks
handle_timeoutinReport that a deadline has passed
handle_writeinQueue an outbound RTP/RTCP/data-channel message
closeinShut the connection down

Nothing is sent eagerly: handle_read, handle_timeout, handle_write and the negotiation methods all queue packets, so drain poll_write after any of them.

handle_event also exists on the trait, but RTCEvent is uninhabited — no value of it can be constructed, so there is nothing to call it with. It reserves the signature for the first inbound event variant.

§Back-pressure

poll_read is the throttle. Undrained data-channel messages leave bytes in SCTP’s reassembly queue, which lowers the receiver-window credit advertised in every SACK, which tells the peer to slow down. Declining to call poll_read is how back-pressure is applied; resume when the application catches up. Media is never throttled this way: RTP arrives over SRTP and is subject to none of SCTP’s flow control, and poll_read interleaves the two by the instant each packet was observed, so a stalled data channel cannot starve video.

§ICE candidates

Because there is no I/O here, there is no candidate gathering either: the application owns the sockets, so it owns gathering. Hand every local candidate to Self::add_local_candidate, and finish with an empty candidate string to signal end-of-gathering — see that method for the details.

§Examples

use rtc::peer_connection::RTCPeerConnectionBuilder;

let mut pc = RTCPeerConnectionBuilder::new().build(Instant::now())?;

A complete event loop is shown in the crate-level documentation.

Implementations§

Source§

impl RTCPeerConnection

Source

pub fn create_offer( &mut self, options: Option<RTCOfferOptions>, ) -> Result<RTCSessionDescription>

Creates an SDP offer to start a new WebRTC connection to a remote peer.

The offer includes information about the attached media tracks, codecs and options supported by the browser, and ICE candidates gathered by the ICE agent. This offer can be sent to a remote peer over a signaling channel to establish a connection.

§Parameters
  • options - Optional configuration for the offer, such as whether to restart ICE.
§Returns

Returns an RTCSessionDescription containing the SDP offer.

§Errors

Returns an error if:

  • The peer connection is closed
  • There’s an error generating the SDP
§Specification

See createOffer

Source

pub fn create_answer( &mut self, _options: Option<RTCAnswerOptions>, ) -> Result<RTCSessionDescription>

Creates an SDP answer in response to an offer from a remote peer.

This method must be called after set_remote_description() has been called with an offer. The answer describes which media formats and codecs this peer will accept and how the connection will be established.

§Parameters
  • options: Optional answer configuration. Currently not used but reserved for future extensions.
§Returns

Returns an RTCSessionDescription containing the SDP answer that should be set as the local description and sent to the remote peer.

§Errors

Returns an error if:

  • No remote description has been set (ErrNoRemoteDescription)
  • The peer connection is closed (ErrConnectionClosed)
  • The signaling state is incorrect (ErrIncorrectSignalingState)
  • SDP generation fails
§Signaling State Requirements

This method can only be called when the signaling state is:

  • HaveRemoteOffer - After receiving an initial offer
  • HaveLocalPranswer - After sending a provisional answer
§Examples
§Basic Answer Flow
use rtc::peer_connection::RTCPeerConnectionBuilder;
use rtc::peer_connection::sdp::RTCSessionDescription;

let mut pc = RTCPeerConnectionBuilder::new().build(Instant::now())?;

// 1. Receive and set remote offer
let offer = RTCSessionDescription::offer(remote_offer_sdp)?;
pc.set_remote_description(Instant::now(), offer)?;

// 2. Create answer
let answer = pc.create_answer(None)?;

// 3. Set as local description
pc.set_local_description(Instant::now(), answer.clone())?;

// 4. Send answer to remote peer
// signaling_channel.send(answer.sdp)?;
§With Media Tracks
use rtc::peer_connection::RTCPeerConnectionBuilder;
use rtc::peer_connection::sdp::RTCSessionDescription;
use rtc::media_stream::MediaStreamTrack;

let mut pc = RTCPeerConnectionBuilder::new().build(Instant::now())?;

// Set remote offer
let offer = RTCSessionDescription::offer(remote_offer_sdp)?;
pc.set_remote_description(Instant::now(), offer)?;

// Add local track before creating answer
pc.add_track(audio_track)?;

// Create answer (will include the track)
let answer = pc.create_answer(None)?;
pc.set_local_description(Instant::now(), answer)?;
§DTLS Role Selection

The answer automatically determines the appropriate DTLS role:

  • Uses answering_dtls_role from settings if configured
  • Defaults to Client (active) for lower latency
  • Uses Server (passive) if remote is ICE-Lite
§Specification
Source

pub fn set_local_description( &mut self, now: Instant, local_description: RTCSessionDescription, ) -> Result<()>

Sets the local description for this peer connection.

This method applies a local SDP description (offer or answer) to the peer connection, updating the local media and transport configuration. It must be called after creating an offer or answer.

§Parameters
  • local_description: The session description to set as the local description. This should be an offer or answer created by create_offer() or create_answer().
§Returns

Returns Ok(()) on success.

§Errors

Returns an error if:

  • The peer connection is closed (ErrConnectionClosed)
  • The SDP type is invalid for the current signaling state
  • SDP parsing fails
  • Transport configuration fails
§Signaling State Transitions

Setting the local description causes signaling state transitions:

  • Offer: Stable → HaveLocalOffer
  • Answer: HaveRemoteOffer → Stable
  • Pranswer: HaveRemoteOffer → HaveLocalPranswer
§Examples
§Setting Local Offer
use rtc::peer_connection::RTCPeerConnectionBuilder;

let mut pc = RTCPeerConnectionBuilder::new().build(Instant::now())?;

// Create offer
let offer = pc.create_offer(None)?;

// Set as local description
pc.set_local_description(Instant::now(), offer.clone())?;

// Now send offer.sdp to remote peer via signaling
// signaling_channel.send(offer.sdp)?;
§Setting Local Answer
use rtc::peer_connection::RTCPeerConnectionBuilder;
use rtc::peer_connection::sdp::RTCSessionDescription;

let mut pc = RTCPeerConnectionBuilder::new().build(Instant::now())?;

// Set remote offer first
let offer = RTCSessionDescription::offer(remote_offer_sdp)?;
pc.set_remote_description(Instant::now(), offer)?;

// Create and set local answer
let answer = pc.create_answer(None)?;
pc.set_local_description(Instant::now(), answer.clone())?;

// Send answer to remote peer
// signaling_channel.send(answer.sdp)?;
§Empty SDP Handling (JSEP 5.4)

If the SDP string is empty, the last offer or answer is reused:

  • For offers: Uses the last generated offer
  • For answers: Uses the last generated answer

This allows re-applying descriptions without regenerating SDP.

§Media and Transport Activation

When setting a local answer:

  • RTP transceivers are activated
  • SCTP transport is started for data channels
  • Media can begin flowing
§Specification
Source

pub fn local_description(&self) -> Option<RTCSessionDescription>

Returns the local session description.

Returns pending_local_description if it is not null, otherwise returns current_local_description. This property is used to determine if set_local_description has already been called.

§Specification

See localDescription

Source

pub fn current_local_description(&self) -> Option<RTCSessionDescription>

Returns the current local description as last successfully negotiated since the last negotiation completed.

This represents the local description from the last offer/answer exchange that was successfully applied, not including any offers currently being negotiated.

Returns None if there is no current local description (e.g., before initial negotiation).

§Specification

See currentLocalDescription

Source

pub fn pending_local_description(&self) -> Option<RTCSessionDescription>

Returns the pending local description if it exists.

This represents the local description from a call to set_local_description() whose corresponding remote description has not yet been applied. This is None if negotiation is not in progress or if a rollback has been performed.

Returns None if there is no pending local description.

§Specification

See pendingLocalDescription

Source

pub fn can_trickle_ice_candidates(&self) -> Option<bool>

Returns whether the remote peer supports trickle ICE.

This value is determined from the remote SDP description after set_remote_description() is called. It checks for “trickle” in the “ice-options” attribute per RFC 8838 and RFC 9429 section 4.1.17.

Returns:

  • None if no remote description has been set yet (unknown)
  • Some(true) if the remote peer indicated trickle ICE support
  • Some(false) if the remote peer did not indicate support
§Specification

See canTrickleIceCandidates

Source

pub fn set_remote_description( &mut self, now: Instant, remote_description: RTCSessionDescription, ) -> Result<()>

Sets the remote description as part of the offer/answer negotiation.

This changes the remote description associated with the connection. This description specifies the properties of the remote end of the connection, including the media format.

§Parameters
  • remote_description - The remote session description to set.
§Errors

Returns an error if:

  • The peer connection is closed
  • The SDP cannot be parsed
  • The media engine fails to update from the remote description
§Specification

See setRemoteDescription

Source

pub fn remote_description(&self) -> Option<&RTCSessionDescription>

Returns the remote session description.

Returns pending_remote_description if it is not null, otherwise returns current_remote_description. This property is used to determine if set_remote_description has already been called.

§Specification

See remoteDescription

Source

pub fn current_remote_description(&self) -> Option<&RTCSessionDescription>

Returns the current remote description as last successfully negotiated since the last negotiation completed.

This represents the remote description from the last offer/answer exchange that was successfully applied, not including any offers currently being negotiated.

Returns None if there is no current remote description (e.g., before initial negotiation).

§Specification

See currentRemoteDescription

Source

pub fn pending_remote_description(&self) -> Option<&RTCSessionDescription>

Returns the pending remote description if it exists.

This represents the remote description from a call to set_remote_description() whose corresponding local description has not yet been applied. This is None if negotiation is not in progress or if a rollback has been performed.

Returns None if there is no pending remote description.

§Specification

See pendingRemoteDescription

Source

pub fn add_remote_candidate( &mut self, remote_candidate: RTCIceCandidateInit, ) -> Result<()>

Adds a remote ICE candidate to the peer connection.

This method provides a remote candidate to the ICE agent. When the remote peer gathers ICE candidates and sends them over the signaling channel, this method should be called to add each candidate.

§Parameters
  • remote_candidate - The ICE candidate initialization data.
§Errors

Returns an error if:

  • No remote description has been set
  • The candidate string is invalid
§Specification

See addIceCandidate

Source

pub fn add_local_candidate( &mut self, local_candidate: RTCIceCandidateInit, ) -> Result<()>

Adds a local ICE candidate to the peer connection.

This has no W3C counterpart: a browser’s ICE agent gathers its own candidates, but this crate performs no I/O, so the application owns the sockets and therefore owns gathering. Every local candidate the connection is to advertise must be handed to this method.

§Signalling the end of gathering

An empty candidate string is the end-of-gathering sentinel. It advertises no candidate; it moves the ICE gathering state to RTCIceGatheringState::Complete and emits RTCPeerConnectionEvent::OnIceGatheringStateChangeEvent with that state. No other call reaches Complete, so a caller that never sends it leaves the connection reporting Gathering forever. Send it once, after the last real candidate:

use rtc::peer_connection::transport::RTCIceCandidateInit;

let mut pc = RTCPeerConnectionBuilder::new().build(Instant::now())?;
// ... add every gathered candidate first ...
pc.add_local_candidate(RTCIceCandidateInit::default())?;
§Parameters
  • local_candidate: The ICE candidate initialization data, or a value whose candidate field is empty to signal end-of-gathering. For candidates of type srflx (server reflexive) or relay, set url to the STUN/TURN server the candidate was gathered from, so that getStats attributes it correctly.
§Errors

Returns an error if a non-empty candidate string cannot be parsed.

Source

pub fn restart_ice(&mut self)

Tells the peer connection that ICE should be restarted.

This method causes the next call to create_offer to generate an offer that will restart ICE. This is useful when network conditions change or the connection fails.

§Specification

See restartIce

Source

pub fn get_configuration(&self) -> &RTCConfiguration

Returns the current configuration of this peer connection.

The returned reference is to the current configuration. To modify the configuration, use set_configuration.

§Specification

See getConfiguration

Source

pub fn set_configuration( &mut self, configuration: RTCConfiguration, ) -> Result<()>

Updates the configuration of this peer connection.

Only the fields the W3C algorithm permits changing after construction are applied; attempting to change the peer identity or the certificate set is an error.

§Parameters
  • configuration: The configuration to apply.
§Errors

Returns an error if:

  • The peer connection is closed (ErrConnectionClosed)
  • The peer identity differs from the one already set (ErrModifyingPeerIdentity)
  • The number of certificates differs from the one already set (ErrModifyingCertificates)
§Specification

See setConfiguration

Source

pub fn create_data_channel( &mut self, label: &str, options: Option<RTCDataChannelInit>, ) -> Result<RTCDataChannel<'_>>

Creates a new data channel with the given label.

The returned handle borrows the peer connection. To reach the channel again later, keep its RTCDataChannelId (from RTCDataChannel::id) and pass it to Self::data_channel.

A channel created here is not immediately usable: unless it was negotiated out-of-band, its SCTP stream is established by the in-band DCEP handshake, and sending before then fails. Wait for RTCDataChannelEvent::OnOpen.

§Parameters
  • label: The channel label. Labels need not be unique.
  • options: Optional configuration such as ordering, reliability and out-of-band negotiation. Defaults are used when None.
§Errors

Returns an error if:

  • The peer connection is closed (ErrConnectionClosed)
  • The label or sub-protocol exceeds the length the DCEP OPEN message can carry
§Specification

See createDataChannel

Source

pub fn get_senders(&self) -> impl Iterator<Item = RTCRtpSenderId> + use<'_>

Returns an iterator over the RTCRtpSender objects.

The RTCRtpSender objects represent the media streams that are being sent to the remote peer.

§Specification

See getSenders

Source

pub fn get_receivers(&self) -> impl Iterator<Item = RTCRtpReceiverId> + use<'_>

Returns an iterator over the RTCRtpReceiver objects.

The RTCRtpReceiver objects represent the media streams that are being received from the remote peer.

§Specification

See getReceivers

Source

pub fn get_transceivers(&self) -> impl Iterator<Item = RTCRtpTransceiverId>

Returns an iterator over the RTCRtpTransceiver objects.

The RTCRtpTransceiver objects represent the combination of an RTCRtpSender and an RTCRtpReceiver that share a common mid.

§Specification

See getTransceivers

Source

pub fn add_track(&mut self, track: MediaStreamTrack) -> Result<RTCRtpSenderId>

Adds a media track to the peer connection.

This method adds a track to the connection, either by finding an existing transceiver that can be reused, or by creating a new transceiver. The track represents media (audio or video) that will be sent to the remote peer.

§Parameters
  • track - The media stream track to add.
§Returns

Returns the ID of the RTCRtpSender that will send this track.

§Errors

Returns an error if the peer connection is closed.

§Specification

See addTrack

Source

pub fn remove_track(&mut self, sender_id: RTCRtpSenderId) -> Result<()>

Removes a track from the peer connection.

This method stops an RTCRtpSender from sending media and marks its transceiver as no longer sending. This will trigger renegotiation.

§Parameters
  • sender_id - The ID of the RTCRtpSender to remove.
§Errors

Returns an error if:

  • The peer connection is closed
  • The sender ID is invalid
§Specification

See removeTrack

Source

pub fn add_transceiver_from_track( &mut self, track: MediaStreamTrack, init: Option<RTCRtpTransceiverInit>, ) -> Result<RTCRtpTransceiverId>

Creates a new RTCRtpTransceiver and adds it to the set of transceivers.

This method creates a transceiver associated with the given track, which can be configured to send, receive, or both.

§Parameters
  • track - The media stream track to associate with the transceiver.
  • init - Optional initialization parameters for the transceiver.
§Returns

Returns the ID of the created transceiver.

§Errors

Returns an error if the peer connection is closed.

§Specification

See addTransceiver

Source

pub fn add_transceiver_from_kind( &mut self, kind: RtpCodecKind, init: Option<RTCRtpTransceiverInit>, ) -> Result<RTCRtpTransceiverId>

Creates a new transceiver for the given media kind and adds it to the set of transceivers.

§Parameters
  • kind: Audio or video.
  • init: Optional direction and encoding parameters; defaults are used when None.
§Errors

Returns an error if:

  • The peer connection is closed (ErrConnectionClosed)
  • The requested direction is not supported for a transceiver created this way
  • No codec is registered in the media engine for kind
§Specification

See addTransceiver

Source

pub fn data_channel( &mut self, id: RTCDataChannelId, ) -> Option<RTCDataChannel<'_>>

Returns a handle to the RTCDataChannel with the given id, or None if no such channel exists on this peer connection.

Source

pub fn sctp(&self) -> Option<RTCSctpTransport<'_>>

The SCTP transport over which data channels are carried.

None until SCTP has been negotiated — that is, until a description establishing an SCTP association has been applied by both sides. A connection carrying only media never has one.

This is the only transport accessor on RTCPeerConnection, matching the W3C interface, which exposes sctp and nothing else. The DTLS and ICE transports are reached by walking from here (or from a sender or receiver):

pc.sctp()?.transport().ice_transport()
§Specifications
Source

pub fn rtp_sender(&mut self, id: RTCRtpSenderId) -> Option<RTCRtpSender<'_>>

Returns a handle to the RTCRtpSender with the given id, or None if no such sender exists on this peer connection.

Source

pub fn rtp_receiver( &mut self, id: RTCRtpReceiverId, ) -> Option<RTCRtpReceiver<'_>>

Returns a handle to the RTCRtpReceiver with the given id, or None if no such receiver exists on this peer connection.

Source

pub fn rtp_transceiver( &mut self, id: RTCRtpTransceiverId, ) -> Option<RTCRtpTransceiver<'_>>

Returns a handle to the RTCRtpTransceiver with the given id, or None if no such transceiver exists on this peer connection.

Source

pub fn get_stats( &mut self, now: Instant, selector: StatsSelector, ) -> RTCStatsReport

Returns a snapshot of accumulated statistics.

This method creates an immutable snapshot of WebRTC statistics at the given timestamp. When selector is StatsSelector::None, the returned RTCStatsReport contains statistics for all aspects of the peer connection. When a sender or receiver is specified, only statistics relevant to that sender/receiver are included.

§Statistics included by selector
  • StatsSelector::None - All statistics for the entire connection
  • StatsSelector::Sender(id) - Outbound RTP streams for the sender and all referenced stats (transport, codec, remote inbound, etc.)
  • StatsSelector::Receiver(id) - Inbound RTP streams for the receiver and all referenced stats (transport, codec, remote outbound, etc.)
§Parameters
  • now - The timestamp to use for all stats in the report. This is passed explicitly to support deterministic testing.
  • selector - Controls which statistics are included in the report.
§Returns

An RTCStatsReport containing snapshots of the selected statistics.

§Examples
use std::time::Instant;
use rtc::peer_connection::RTCPeerConnectionBuilder;
use rtc::statistics::StatsSelector;

let mut pc = RTCPeerConnectionBuilder::new().build(Instant::now())?;

// Get all stats
let report = pc.get_stats(Instant::now(), StatsSelector::None);

// Access peer connection stats
if let Some(pc_stats) = report.peer_connection() {
    println!("Data channels opened: {}", pc_stats.data_channels_opened);
}

// Iterate over inbound RTP streams
for stream in report.inbound_rtp_streams() {
    println!("SSRC {}: {} packets received", stream.received_rtp_stream_stats.rtp_stream_stats.ssrc, stream.received_rtp_stream_stats.packets_received);
}
§Specification

See getStats and The stats selection algorithm

Trait Implementations§

Source§

impl Protocol<TransportMessage<BytesMut>, TaggedRTCMessage, TaggedRTCEvent> for RTCPeerConnection

Source§

type Rout = TaggedRTCMessage

Output read message type Read more
Source§

type Wout = TransportMessage<BytesMut>

Output write message type Read more
Source§

type Eout = RTCPeerConnectionEvent

Output event type Read more
Source§

type Error = Error

Error type for protocol operations
Source§

type Time = Instant

Time/Instant type for timeout handling Read more
Source§

fn handle_read(&mut self, msg: TaggedBytesMut) -> Result<(), Self::Error>

Handle an incoming read message. Read more
Source§

fn poll_read(&mut self) -> Option<Self::Rout>

Poll for a processed read message. Read more
Source§

fn handle_write(&mut self, msg: TaggedRTCMessage) -> Result<(), Self::Error>

Handle an outgoing write message. Read more
Source§

fn poll_write(&mut self) -> Option<Self::Wout>

Poll for a processed write message. Read more
Source§

fn handle_event(&mut self, evt: TaggedRTCEvent) -> Result<(), Self::Error>

Handle a custom event. Read more
Source§

fn poll_event(&mut self) -> Option<Self::Eout>

Poll for a generated event. Read more
Source§

fn handle_timeout(&mut self, now: Instant) -> Result<(), Self::Error>

Handle a timeout event. Read more
Source§

fn poll_timeout(&mut self) -> Option<Instant>

Poll for the next timeout deadline. Read more
Source§

fn close(&mut self) -> Result<(), Self::Error>

Close the protocol. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for RTCPeerConnection

§

impl !Sync for RTCPeerConnection

§

impl !UnwindSafe for RTCPeerConnection

§

impl Forget for RTCPeerConnection

§

impl Freeze for RTCPeerConnection
where *const u8 is !null: Freeze, PhantomData<RTCIceServer>: Freeze, PhantomData<u8>: Freeze, PhantomData<RTCCertificate>: Freeze, PhantomData<RTCRtpCodecParameters>: Freeze, PhantomData<MediaEngineHeaderExtension>: Freeze, PhantomData<(u16, MediaEngineHeaderExtension)>: Freeze, *const ArcInner<dyn RTCCryptoProvider> is !null: Freeze, PhantomData<ArcInner<dyn RTCCryptoProvider>>: Freeze, PhantomData<NetworkType>: Freeze, PhantomData<String>: Freeze, PhantomData<SrtpProtectionProfile>: Freeze, PhantomData<CipherSuiteId>: Freeze, *const ArcInner<dyn Fn(isize) -> String + Sync + Send> is !null: Freeze, PhantomData<ArcInner<dyn Fn(isize) -> String + Sync + Send>>: Freeze, *const dyn Interceptor<Time = Instant, Eout = (), Error = Error, Wout = TransportMessage<AttributedPacket>, Rout = TransportMessage<AttributedPacket>> is !null: Freeze, PhantomData<dyn Interceptor<Time = Instant, Eout = (), Error = Error, Wout = TransportMessage<AttributedPacket>, Rout = TransportMessage<AttributedPacket>>>: Freeze, PhantomData<Bandwidth>: Freeze, PhantomData<TimeDescription>: Freeze, PhantomData<TimeZone>: Freeze, PhantomData<Attribute>: Freeze, PhantomData<MediaDescription>: Freeze, PhantomData<TaggedRTCMessageInternal>: Freeze, PhantomData<TaggedRTCEventInternal>: Freeze, PhantomData<Candidate>: Freeze, PhantomData<CandidatePair>: Freeze, PhantomData<BindingRequest>: Freeze, PhantomData<(u64, String)>: Freeze, PhantomData<Query>: Freeze, PhantomData<TransportMessage<BytesMut>>: Freeze, PhantomData<MdnsEvent>: Freeze, PhantomData<(u64, Candidate)>: Freeze, PhantomData<CandidateType>: Freeze, PhantomData<Url>: Freeze, PhantomData<TaggedEvent>: Freeze, *const ArcInner<HandshakeConfig> is !null: Freeze, PhantomData<ArcInner<HandshakeConfig>>: Freeze, PhantomData<(SocketAddr, DTLSConn)>: Freeze, PhantomData<Vec<u8>>: Freeze, PhantomData<(u32, AssociationHandle)>: Freeze, PhantomData<Entry<AssociationMeta>>: Freeze, *const dyn AssociationIdGenerator is !null: Freeze, PhantomData<dyn AssociationIdGenerator>: Freeze, *const ArcInner<EndpointConfig> is !null: Freeze, PhantomData<ArcInner<EndpointConfig>>: Freeze, *const ArcInner<ServerConfig> is !null: Freeze, PhantomData<ArcInner<ServerConfig>>: Freeze, PhantomData<(AssociationHandle, Association)>: Freeze, PhantomData<((AssociationHandle, u16), ())>: Freeze, PhantomData<(AssociationHandle, TransportContext)>: Freeze, *const dyn Cipher is !null: Freeze, PhantomData<dyn Cipher>: Freeze, PhantomData<(u32, SrtpSsrcState)>: Freeze, PhantomData<(u32, SrtcpSsrcState)>: Freeze, *const dyn Fn() -> Box<dyn ReplayDetector> + Sync + Send is !null: Freeze, PhantomData<dyn Fn() -> Box<dyn ReplayDetector> + Sync + Send>: Freeze, PhantomData<TaggedRTCMessage>: Freeze, PhantomData<RTCPeerConnectionEvent>: Freeze, PhantomData<(String, IceCandidatePairAccumulator)>: Freeze, PhantomData<(String, IceCandidateAccumulator)>: Freeze, PhantomData<(String, CertificateStatsAccumulator)>: Freeze, PhantomData<(String, CodecStatsAccumulator)>: Freeze, PhantomData<(usize, DataChannelStatsAccumulator)>: Freeze, PhantomData<(u32, InboundRtpStreamAccumulator)>: Freeze, PhantomData<(u32, OutboundRtpStreamAccumulator)>: Freeze, PhantomData<(String, MediaSourceStatsAccumulator)>: Freeze, PhantomData<(String, AudioPlayoutStatsAccumulator)>: Freeze, PhantomData<(u32, u32)>: Freeze, PhantomData<(usize, RTCDataChannelInternal)>: Freeze, PhantomData<(u16, usize)>: Freeze, PhantomData<RTCRtpTransceiverInternal>: Freeze,

§

impl Move for RTCPeerConnection

§

impl Send for RTCPeerConnection
where RawVecInner: Send, &'static [u8]: Send, Arc<dyn SigningKey>: Send, RawTable<(u16, MediaEngineHeaderExtension)>: Send, Arc<dyn RTCCryptoProvider>: Send, Arc<dyn Fn(isize) -> String + Sync + Send>: Send, BoxRaw<dyn Interceptor<Time = Instant, Eout = (), Error = Error, Wout = TransportMessage<AttributedPacket>, Rout = TransportMessage<AttributedPacket>>>: Send, BytesMut: Send, Bytes: Send, BoxRaw<dyn Packet>: Send, BoxRaw<dyn Cipher>: Send, RawTable<(u32, SrtpSsrcState)>: Send, RawTable<(u32, SrtcpSsrcState)>: Send, BoxRaw<dyn Fn() -> Box<dyn ReplayDetector> + Sync + Send>: Send, RawTable<(u64, Candidate)>: Send, BoxRaw<Candidate>: Send, Arc<HandshakeConfig>: Send, RawTable<(SocketAddr, DTLSConn)>: Send, RawTable<(u32, AssociationHandle)>: Send, RawTable<(u64, u32)>: Send, BoxRaw<dyn AssociationIdGenerator>: Send, Arc<EndpointConfig>: Send, Arc<ServerConfig>: Send, RawTable<(AssociationHandle, Association)>: Send, RawTable<((AssociationHandle, u16), ())>: Send, RawTable<(AssociationHandle, TransportContext)>: Send, RawTable<(String, IceCandidatePairAccumulator)>: Send, RawTable<(String, IceCandidateAccumulator)>: Send, RawTable<(String, CertificateStatsAccumulator)>: Send, RawTable<(String, CodecStatsAccumulator)>: Send, RawTable<(usize, DataChannelStatsAccumulator)>: Send, RawTable<(u32, InboundRtpStreamAccumulator)>: Send, RawTable<(u32, OutboundRtpStreamAccumulator)>: Send, RawTable<(String, MediaSourceStatsAccumulator)>: Send, RawTable<(String, AudioPlayoutStatsAccumulator)>: Send, RawTable<(u32, u32)>: Send, RawTable<(usize, RTCDataChannelInternal)>: Send, RawTable<(u16, usize)>: Send, RawTable<(bool, ())>: Send,

§

impl Unpin for RTCPeerConnection
where *const u8 is !null: Unpin, &'static [u8]: Unpin, Arc<dyn SigningKey>: Unpin, Arc<dyn RTCCryptoProvider>: Unpin, Arc<dyn Fn(isize) -> String + Sync + Send>: Unpin, Box<dyn Interceptor<Time = Instant, Eout = (), Error = Error, Wout = TransportMessage<AttributedPacket>, Rout = TransportMessage<AttributedPacket>>>: Unpin, *mut Shared: Unpin, *const u8: Unpin, Align8<*mut ()>: Unpin, &'static Vtable: Unpin, Box<dyn Packet>: Unpin, Box<dyn Cipher>: Unpin, Box<dyn ReplayDetector>: Unpin, Box<dyn Fn() -> Box<dyn ReplayDetector> + Sync + Send>: Unpin, Box<Candidate>: Unpin, Arc<HandshakeConfig>: Unpin, Box<dyn CipherSuite>: Unpin, Box<dyn ActiveKeyExchange>: Unpin, Box<dyn Flight>: Unpin, Box<dyn AssociationIdGenerator>: Unpin, Arc<EndpointConfig>: Unpin, Arc<ServerConfig>: Unpin, Box<dyn Param>: Unpin, NonZero<u64>: Unpin, Box<dyn Chunk>: Unpin,

§

impl UnsafeUnpin for RTCPeerConnection
where *const u8 is !null: UnsafeUnpin, PhantomData<RTCIceServer>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<RTCCertificate>: UnsafeUnpin, PhantomData<RTCRtpCodecParameters>: UnsafeUnpin, PhantomData<MediaEngineHeaderExtension>: UnsafeUnpin, PhantomData<(u16, MediaEngineHeaderExtension)>: UnsafeUnpin, *const ArcInner<dyn RTCCryptoProvider> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn RTCCryptoProvider>>: UnsafeUnpin, PhantomData<NetworkType>: UnsafeUnpin, PhantomData<String>: UnsafeUnpin, PhantomData<SrtpProtectionProfile>: UnsafeUnpin, PhantomData<CipherSuiteId>: UnsafeUnpin, *const ArcInner<dyn Fn(isize) -> String + Sync + Send> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Fn(isize) -> String + Sync + Send>>: UnsafeUnpin, *const dyn Interceptor<Time = Instant, Eout = (), Error = Error, Wout = TransportMessage<AttributedPacket>, Rout = TransportMessage<AttributedPacket>> is !null: UnsafeUnpin, PhantomData<dyn Interceptor<Time = Instant, Eout = (), Error = Error, Wout = TransportMessage<AttributedPacket>, Rout = TransportMessage<AttributedPacket>>>: UnsafeUnpin, PhantomData<Bandwidth>: UnsafeUnpin, PhantomData<TimeDescription>: UnsafeUnpin, PhantomData<TimeZone>: UnsafeUnpin, PhantomData<Attribute>: UnsafeUnpin, PhantomData<MediaDescription>: UnsafeUnpin, PhantomData<TaggedRTCMessageInternal>: UnsafeUnpin, PhantomData<TaggedRTCEventInternal>: UnsafeUnpin, PhantomData<Candidate>: UnsafeUnpin, PhantomData<CandidatePair>: UnsafeUnpin, PhantomData<BindingRequest>: UnsafeUnpin, PhantomData<(u64, String)>: UnsafeUnpin, PhantomData<Query>: UnsafeUnpin, PhantomData<TransportMessage<BytesMut>>: UnsafeUnpin, PhantomData<MdnsEvent>: UnsafeUnpin, PhantomData<(u64, Candidate)>: UnsafeUnpin, PhantomData<CandidateType>: UnsafeUnpin, PhantomData<Url>: UnsafeUnpin, PhantomData<TaggedEvent>: UnsafeUnpin, *const ArcInner<HandshakeConfig> is !null: UnsafeUnpin, PhantomData<ArcInner<HandshakeConfig>>: UnsafeUnpin, PhantomData<(SocketAddr, DTLSConn)>: UnsafeUnpin, PhantomData<Vec<u8>>: UnsafeUnpin, PhantomData<(u32, AssociationHandle)>: UnsafeUnpin, PhantomData<Entry<AssociationMeta>>: UnsafeUnpin, *const dyn AssociationIdGenerator is !null: UnsafeUnpin, PhantomData<dyn AssociationIdGenerator>: UnsafeUnpin, *const ArcInner<EndpointConfig> is !null: UnsafeUnpin, PhantomData<ArcInner<EndpointConfig>>: UnsafeUnpin, *const ArcInner<ServerConfig> is !null: UnsafeUnpin, PhantomData<ArcInner<ServerConfig>>: UnsafeUnpin, PhantomData<(AssociationHandle, Association)>: UnsafeUnpin, PhantomData<((AssociationHandle, u16), ())>: UnsafeUnpin, PhantomData<(AssociationHandle, TransportContext)>: UnsafeUnpin, *const dyn Cipher is !null: UnsafeUnpin, PhantomData<dyn Cipher>: UnsafeUnpin, PhantomData<(u32, SrtpSsrcState)>: UnsafeUnpin, PhantomData<(u32, SrtcpSsrcState)>: UnsafeUnpin, *const dyn Fn() -> Box<dyn ReplayDetector> + Sync + Send is !null: UnsafeUnpin, PhantomData<dyn Fn() -> Box<dyn ReplayDetector> + Sync + Send>: UnsafeUnpin, PhantomData<TaggedRTCMessage>: UnsafeUnpin, PhantomData<RTCPeerConnectionEvent>: UnsafeUnpin, PhantomData<(String, IceCandidatePairAccumulator)>: UnsafeUnpin, PhantomData<(String, IceCandidateAccumulator)>: UnsafeUnpin, PhantomData<(String, CertificateStatsAccumulator)>: UnsafeUnpin, PhantomData<(String, CodecStatsAccumulator)>: UnsafeUnpin, PhantomData<(usize, DataChannelStatsAccumulator)>: UnsafeUnpin, PhantomData<(u32, InboundRtpStreamAccumulator)>: UnsafeUnpin, PhantomData<(u32, OutboundRtpStreamAccumulator)>: UnsafeUnpin, PhantomData<(String, MediaSourceStatsAccumulator)>: UnsafeUnpin, PhantomData<(String, AudioPlayoutStatsAccumulator)>: UnsafeUnpin, PhantomData<(u32, u32)>: UnsafeUnpin, PhantomData<(usize, RTCDataChannelInternal)>: UnsafeUnpin, PhantomData<(u16, usize)>: UnsafeUnpin, PhantomData<RTCRtpTransceiverInternal>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.