Struct webrtc::peer::peer_connection::RTCPeerConnection[][src]

pub struct RTCPeerConnection { /* fields omitted */ }
Expand description

PeerConnection represents a WebRTC connection that establishes a peer-to-peer communications with another PeerConnection instance in a browser, or to another endpoint implementing the required protocols.

Implementations

on_signaling_state_change sets an event handler which is invoked when the peer connection’s signaling state changes

on_data_channel sets an event handler which is invoked when a data channel message arrives from a remote peer.

on_negotiation_needed sets an event handler which is invoked when a change has occurred which requires session negotiation

on_ice_candidate sets an event handler which is invoked when a new ICE candidate is found. Take note that the handler is gonna be called with a nil pointer when gathering is finished.

on_ice_gathering_state_change sets an event handler which is invoked when the ICE candidate gathering state has changed.

on_track sets an event handler which is called when remote track arrives from a remote peer.

on_ice_connection_state_change sets an event handler which is called when an ICE connection state is changed.

on_peer_connection_state_change sets an event handler which is called when the PeerConnectionState has changed

get_configuration returns a Configuration object representing the current configuration of this PeerConnection object. The returned object is a copy and direct mutation on it will not take affect until set_configuration has been called with Configuration passed as its only argument. https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-getconfiguration

create_offer starts the PeerConnection and generates the localDescription https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer

create_answer starts the PeerConnection and generates the localDescription

set_local_description sets the SessionDescription of the local peer

local_description returns PendingLocalDescription if it is not null and otherwise it returns CurrentLocalDescription. This property is used to determine if set_local_description has already been called. https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-localdescription

set_remote_description sets the SessionDescription of the remote peer

remote_description returns pending_remote_description if it is not null and otherwise it returns current_remote_description. This property is used to determine if setRemoteDescription has already been called. https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-remotedescription

add_ice_candidate accepts an ICE candidate string and adds it to the existing set of candidates.

ice_connection_state returns the ICE connection state of the PeerConnection instance.

get_senders returns the RTPSender that are currently attached to this PeerConnection

get_receivers returns the RTPReceivers that are currently attached to this PeerConnection

get_transceivers returns the RtpTransceiver that are currently attached to this PeerConnection

add_track adds a Track to the PeerConnection

remove_track removes a Track from the PeerConnection

add_transceiver_from_kind Create a new RtpTransceiver and adds it to the set of transceivers.

add_transceiver_from_track Create a new RtpTransceiver(SendRecv or SendOnly) and add it to the set of transceivers.

create_data_channel creates a new DataChannel object with the given label and optional DataChannelInit used to configure properties of the underlying channel such as data reliability.

set_identity_provider is used to configure an identity provider to generate identity assertions

write_rtcp sends a user provided RTCP packet to the connected peer. If no peer is connected the packet is discarded. It also runs any configured interceptors.

close ends the PeerConnection

CurrentLocalDescription represents the local description that was successfully negotiated the last time the PeerConnection transitioned into the stable state plus any local candidates that have been generated by the ICEAgent since the offer or answer was created.

PendingLocalDescription represents a local description that is in the process of being negotiated plus any local candidates that have been generated by the ICEAgent since the offer or answer was created. If the PeerConnection is in the stable state, the value is null.

current_remote_description represents the last remote description that was successfully negotiated the last time the PeerConnection transitioned into the stable state plus any remote candidates that have been supplied via add_icecandidate() since the offer or answer was created.

pending_remote_description represents a remote description that is in the process of being negotiated, complete with any remote candidates that have been supplied via add_icecandidate() since the offer or answer was created. If the PeerConnection is in the stable state, the value is null.

signaling_state attribute returns the signaling state of the PeerConnection instance.

icegathering_state attribute returns the ICE gathering state of the PeerConnection instance.

connection_state attribute returns the connection state of the PeerConnection instance.

sctp returns the SCTPTransport for this PeerConnection

The SCTP transport over which SCTP data is sent and received. If SCTP has not been negotiated, the value is nil. https://www.w3.org/TR/webrtc/#attributes-15

gathering_complete_promise is a Pion specific helper function that returns a channel that is closed when gathering is complete. This function may be helpful in cases where you are unable to trickle your ICE Candidates.

It is better to not use this function, and instead trickle candidates. If you use this function you will see longer connection startup times. When the call is connected you will see no impact however.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Converts self into a target type. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

Attempts to convert self into T using TryInto<T>. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.