pub struct SettingEngine { /* private fields */ }
Expand description

SettingEngine allows influencing behavior in ways that are not supported by the WebRTC API. This allows us to support additional use-cases without deviating from the WebRTC API elsewhere.

Implementations§

source§

impl SettingEngine

source

pub fn detach_data_channels(&mut self)

detach_data_channels enables detaching data channels. When enabled data channels have to be detached in the OnOpen callback using the DataChannel.Detach method.

source

pub fn set_srtp_protection_profiles( &mut self, profiles: Vec<SrtpProtectionProfile> )

set_srtp_protection_profiles allows the user to override the default srtp Protection Profiles The default srtp protection profiles are provided by the function defaultSrtpProtectionProfiles

source

pub fn set_ice_timeouts( &mut self, disconnected_timeout: Option<Duration>, failed_timeout: Option<Duration>, keep_alive_interval: Option<Duration> )

set_ice_timeouts sets the behavior around ICE Timeouts

  • disconnected_timeout is the duration without network activity before a Agent is considered disconnected. Default is 5 Seconds
  • failed_timeout is the duration without network activity before a Agent is considered failed after disconnected. Default is 25 Seconds
  • keep_alive_interval is how often the ICE Agent sends extra traffic if there is no activity, if media is flowing no traffic will be sent. Default is 2 seconds
source

pub fn set_host_acceptance_min_wait(&mut self, t: Option<Duration>)

set_host_acceptance_min_wait sets the icehost_acceptance_min_wait

source

pub fn set_srflx_acceptance_min_wait(&mut self, t: Option<Duration>)

set_srflx_acceptance_min_wait sets the icesrflx_acceptance_min_wait

source

pub fn set_prflx_acceptance_min_wait(&mut self, t: Option<Duration>)

set_prflx_acceptance_min_wait sets the iceprflx_acceptance_min_wait

source

pub fn set_relay_acceptance_min_wait(&mut self, t: Option<Duration>)

set_relay_acceptance_min_wait sets the icerelay_acceptance_min_wait

source

pub fn set_udp_network(&mut self, udp_network: UDPNetwork)

set_udp_network allows ICE traffic to come through Ephemeral or UDPMux. UDPMux drastically simplifying deployments where ports will need to be opened/forwarded. UDPMux should be started prior to creating PeerConnections.

source

pub fn set_lite(&mut self, lite: bool)

set_lite configures whether or not the ice agent should be a lite agent

source

pub fn set_network_types(&mut self, candidate_types: Vec<NetworkType>)

set_network_types configures what types of candidate networks are supported during local and server reflexive gathering.

source

pub fn set_interface_filter(&mut self, filter: InterfaceFilterFn)

set_interface_filter sets the filtering functions when gathering ICE candidates This can be used to exclude certain network interfaces from ICE. Which may be useful if you know a certain interface will never succeed, or if you wish to reduce the amount of information you wish to expose to the remote peer

source

pub fn set_ip_filter(&mut self, filter: IpFilterFn)

set_ip_filter sets the filtering functions when gathering ICE candidates This can be used to exclude certain ip from ICE. Which may be useful if you know a certain ip will never succeed, or if you wish to reduce the amount of information you wish to expose to the remote peer

source

pub fn set_nat_1to1_ips( &mut self, ips: Vec<String>, candidate_type: RTCIceCandidateType )

set_nat_1to1_ips sets a list of external IP addresses of 1:1 (D)NAT and a candidate type for which the external IP address is used. This is useful when you are host a server using Pion on an AWS EC2 instance which has a private address, behind a 1:1 DNAT with a public IP (e.g. Elastic IP). In this case, you can give the public IP address so that Pion will use the public IP address in its candidate instead of the private IP address. The second argument, candidate_type, is used to tell Pion which type of candidate should use the given public IP address. Two types of candidates are supported:

ICECandidateTypeHost: The public IP address will be used for the host candidate in the SDP. ICECandidateTypeSrflx: A server reflexive candidate with the given public IP address will be added to the SDP.

Please note that if you choose ICECandidateTypeHost, then the private IP address won’t be advertised with the peer. Also, this option cannot be used along with mDNS.

If you choose ICECandidateTypeSrflx, it simply adds a server reflexive candidate with the public IP. The host candidate is still available along with mDNS capabilities unaffected. Also, you cannot give STUN server URL at the same time. It will result in an error otherwise.

source

pub fn set_answering_dtls_role(&mut self, role: DTLSRole) -> Result<()>

set_answering_dtls_role sets the dtls_transport role that is selected when offering The dtls_transport role controls if the WebRTC Client as a client or server. This may be useful when interacting with non-compliant clients or debugging issues.

DTLSRoleActive: Act as dtls_transport Client, send the ClientHello and starts the handshake DTLSRolePassive: Act as dtls_transport Server, wait for ClientHello

source

pub fn set_vnet(&mut self, vnet: Option<Arc<Net>>)

set_vnet sets the VNet instance that is passed to ice VNet is a virtual network layer, allowing users to simulate different topologies, latency, loss and jitter. This can be useful for learning WebRTC concepts or testing your application in a lab environment

source

pub fn set_ice_multicast_dns_mode( &mut self, multicast_dns_mode: MulticastDnsMode )

set_ice_multicast_dns_mode controls if ice queries and generates mDNS ICE Candidates

source

pub fn set_multicast_dns_host_name(&mut self, host_name: String)

set_multicast_dns_host_name sets a static HostName to be used by ice instead of generating one on startup This should only be used for a single PeerConnection. Having multiple PeerConnections with the same HostName will cause undefined behavior

source

pub fn set_ice_credentials( &mut self, username_fragment: String, password: String )

set_ice_credentials sets a staic uFrag/uPwd to be used by ice This is useful if you want to do signalless WebRTC session, or having a reproducible environment with static credentials

source

pub fn disable_certificate_fingerprint_verification( &mut self, is_disabled: bool )

disable_certificate_fingerprint_verification disables fingerprint verification after dtls_transport Handshake has finished

source

pub fn allow_insecure_verification_algorithm(&mut self, is_allowed: bool)

allow_insecure_verification_algorithm allows the usage of certain signature verification algorithm that are known to be vulnerable or deprecated.

source

pub fn set_dtls_replay_protection_window(&mut self, n: usize)

set_dtls_replay_protection_window sets a replay attack protection window size of dtls_transport connection.

source

pub fn set_srtp_replay_protection_window(&mut self, n: usize)

set_srtp_replay_protection_window sets a replay attack protection window size of srtp session.

source

pub fn set_srtcp_replay_protection_window(&mut self, n: usize)

set_srtcp_replay_protection_window sets a replay attack protection window size of srtcp session.

source

pub fn disable_srtp_replay_protection(&mut self, is_disabled: bool)

disable_srtp_replay_protection disables srtp replay protection.

source

pub fn disable_srtcp_replay_protection(&mut self, is_disabled: bool)

disable_srtcp_replay_protection disables srtcp replay protection.

source

pub fn set_sdp_media_level_fingerprints( &mut self, sdp_media_level_fingerprints: bool )

set_sdp_media_level_fingerprints configures the logic for dtls_transport Fingerprint insertion If true, fingerprints will be inserted in the sdp at the fingerprint level, instead of the session level. This helps with compatibility with some webrtc implementations.

source

pub fn disable_media_engine_copy(&mut self, is_disabled: bool)

disable_media_engine_copy stops the MediaEngine from being copied. This allows a user to modify the MediaEngine after the PeerConnection has been constructed. This is useful if you wish to modify codecs after signaling. Make sure not to share MediaEngines between PeerConnections.

source

pub fn set_receive_mtu(&mut self, receive_mtu: usize)

set_receive_mtu sets the size of read buffer that copies incoming packets. This is optional. Leave this 0 for the default receive_mtu

source

pub fn set_mid_generator( &mut self, f: impl Fn(isize) -> String + Send + Sync + 'static )

Sets a callback used to generate mid for transceivers created by this side of the RTCPeerconnection. By having separate “naming schemes” for mids generated by either side of a connection, it’s possible to reduce complexity when handling SDP offers/answers clashing.

The isize argument is currently greatest seen numeric mid. Since mids don’t need to be numeric this doesn’t necessarily indicating anything.

Note that the spec says: All MID values MUST be generated in a fashion that does not leak user information, e.g., randomly or using a per-PeerConnection counter, and SHOULD be 3 bytes or less, to allow them to efficiently fit into the RTP header extension

Trait Implementations§

source§

impl Clone for SettingEngine

source§

fn clone(&self) -> SettingEngine

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for SettingEngine

source§

fn default() -> SettingEngine

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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
§

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

§

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

§

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

§

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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V