pub struct RtcConfigurationBuilder { /* private fields */ }Implementations§
Source§impl RtcConfigurationBuilder
impl RtcConfigurationBuilder
pub fn new() -> Self
pub fn enable_latching(self, enable: bool) -> Self
pub fn probation_max_packets(self, max: Option<u8>) -> Self
pub fn enable_ice_lite(self, enable: bool) -> Self
pub fn prefer_srflx_over_natted_host(self, enable: bool) -> Self
pub fn enable_upnp(self, enable: bool) -> Self
pub fn upnp_lease_duration(self, duration_secs: u32) -> Self
pub fn upnp_discovery_timeout(self, timeout: Duration) -> Self
Sourcepub fn upnp_refresh_interval(self, interval: Duration) -> Self
pub fn upnp_refresh_interval(self, interval: Duration) -> Self
Set how often UPnP port mappings are refreshed to keep the router lease alive.
pub fn ice_server(self, server: IceServer) -> Self
pub fn ice_transport_policy(self, policy: IceTransportPolicy) -> Self
pub fn bundle_policy(self, policy: BundlePolicy) -> Self
pub fn rtcp_mux_policy(self, policy: RtcpMuxPolicy) -> Self
pub fn certificate(self, cert: CertificateConfig) -> Self
pub fn transport_mode(self, mode: TransportMode) -> Self
pub fn media_capabilities(self, capabilities: MediaCapabilities) -> Self
pub fn external_ip(self, ip: String) -> Self
pub fn external_port(self, port: u16) -> Self
pub fn bind_ip(self, ip: String) -> Self
pub fn disable_ipv6(self, disable: bool) -> Self
pub fn ssrc_start(self, start: u32) -> Self
pub fn stun_timeout(self, timeout: Duration) -> Self
pub fn nomination_timeout(self, timeout: Duration) -> Self
pub fn rtp_port_range(self, start: u16, end: u16) -> Self
pub fn ice_gather_udp_hosts(self, enable: bool) -> Self
Sourcepub fn ice_include_loopback_candidates(self, enable: bool) -> Self
pub fn ice_include_loopback_candidates(self, enable: bool) -> Self
Gather and advertise loopback host candidates (default false). See
RtcConfiguration::ice_include_loopback_candidates.
pub fn tcp_port_range(self, start: u16, end: u16) -> Self
pub fn dtls_buffer_size(self, size: usize) -> Self
pub fn sctp_rto_initial(self, duration: Duration) -> Self
pub fn sctp_rto_min(self, duration: Duration) -> Self
pub fn sctp_rto_max(self, duration: Duration) -> Self
pub fn sctp_max_association_retransmits(self, count: u32) -> Self
pub fn sctp_receive_window(self, size: usize) -> Self
pub fn sctp_heartbeat_interval(self, duration: Duration) -> Self
pub fn sctp_max_heartbeat_failures(self, count: u32) -> Self
Sourcepub fn sctp_max_burst(self, packets: usize) -> Self
pub fn sctp_max_burst(self, packets: usize) -> Self
Set the maximum burst size for SCTP in number of MTU-sized packets. 0 means use the default heuristic (16 packets normal, 4 in recovery). For rate-limited TURN relays, a value of 2-4 can reduce burst-induced packet loss.
Sourcepub fn sctp_max_cwnd(self, size: usize) -> Self
pub fn sctp_max_cwnd(self, size: usize) -> Self
Set the maximum congestion window size in bytes. Default is 256 KB. For high-latency TURN relays, consider 512KB-1MB.
Sourcepub fn sctp_max_buffered_amount(self, bytes: usize) -> Self
pub fn sctp_max_buffered_amount(self, bytes: usize) -> Self
Per-data-channel send-side buffered-amount limit in bytes.
Default is 256 KB. Set to 0 for unbounded (compatibility with pre-0.3.114
behavior that had no gate). A non-zero limit bounds the sum of in-flight
and queued payload bytes per data channel, blocking send()/send_text()
until the buffer drains below the threshold.
pub fn ice_connection_timeout(self, timeout: Duration) -> Self
pub fn ice_disconnect_threshold(self, threshold: Duration) -> Self
pub fn ice_disconnect_grace(self, grace: Duration) -> Self
pub fn rtp_buffer_capacity(self, capacity: usize) -> Self
pub fn buffer_drop_strategy(self, strategy: BufferDropStrategy) -> Self
pub fn buffer_stats_log_interval(self, interval: Duration) -> Self
pub fn ice_tcp_policy(self, policy: IceTcpPolicy) -> Self
Sourcepub fn ice_udp_mux(self, enable: bool) -> Self
pub fn ice_udp_mux(self, enable: bool) -> Self
Enable process-wide shared ICE UDP socket (single-port multiplexing).
Requires ice_udp_mux_port to also be set.
Sourcepub fn ice_udp_mux_port(self, port: u16) -> Self
pub fn ice_udp_mux_port(self, port: u16) -> Self
Set the shared UDP mux port. Must be set when ice_udp_mux is enabled.
pub fn sdp_compatibility(self, mode: SdpCompatibilityMode) -> Self
pub fn cname(self, cname: String) -> Self
Sourcepub fn receiver_interceptor(
self,
interceptor: Arc<dyn RtpReceiverInterceptor>,
) -> Self
pub fn receiver_interceptor( self, interceptor: Arc<dyn RtpReceiverInterceptor>, ) -> Self
Append a receiver interceptor (fires on every incoming RTP packet, pre-depacketize).
Sourcepub fn sender_interceptor(
self,
interceptor: Arc<dyn RtpSenderInterceptor>,
) -> Self
pub fn sender_interceptor( self, interceptor: Arc<dyn RtpSenderInterceptor>, ) -> Self
Append a sender interceptor (fires on every outgoing RTP packet, post seq/timestamp rewrite).
Sourcepub fn runtime_handle(self, handle: Handle) -> Self
pub fn runtime_handle(self, handle: Handle) -> Self
Set the runtime handle for spawning internal tasks (ICE runner, DTLS, RTCP loops, etc.). When set, all rustrtc-internal tokio::spawn calls go through this runtime instead of the ambient tokio runtime.