Skip to main content

RtcConfigurationBuilder

Struct RtcConfigurationBuilder 

Source
pub struct RtcConfigurationBuilder { /* private fields */ }

Implementations§

Source§

impl RtcConfigurationBuilder

Source

pub fn new() -> Self

Source

pub fn enable_latching(self, enable: bool) -> Self

Source

pub fn probation_max_packets(self, max: Option<u8>) -> Self

Source

pub fn enable_ice_lite(self, enable: bool) -> Self

Source

pub fn prefer_srflx_over_natted_host(self, enable: bool) -> Self

Source

pub fn enable_upnp(self, enable: bool) -> Self

Source

pub fn upnp_lease_duration(self, duration_secs: u32) -> Self

Source

pub fn upnp_discovery_timeout(self, timeout: Duration) -> Self

Source

pub fn upnp_refresh_interval(self, interval: Duration) -> Self

Set how often UPnP port mappings are refreshed to keep the router lease alive.

Source

pub fn ice_server(self, server: IceServer) -> Self

Source

pub fn ice_transport_policy(self, policy: IceTransportPolicy) -> Self

Source

pub fn bundle_policy(self, policy: BundlePolicy) -> Self

Source

pub fn rtcp_mux_policy(self, policy: RtcpMuxPolicy) -> Self

Source

pub fn certificate(self, cert: CertificateConfig) -> Self

Source

pub fn transport_mode(self, mode: TransportMode) -> Self

Source

pub fn media_capabilities(self, capabilities: MediaCapabilities) -> Self

Source

pub fn external_ip(self, ip: String) -> Self

Source

pub fn external_port(self, port: u16) -> Self

Source

pub fn bind_ip(self, ip: String) -> Self

Source

pub fn disable_ipv6(self, disable: bool) -> Self

Source

pub fn ssrc_start(self, start: u32) -> Self

Source

pub fn stun_timeout(self, timeout: Duration) -> Self

Source

pub fn nomination_timeout(self, timeout: Duration) -> Self

Source

pub fn rtp_port_range(self, start: u16, end: u16) -> Self

Source

pub fn ice_gather_udp_hosts(self, enable: bool) -> Self

Source

pub fn ice_include_loopback_candidates(self, enable: bool) -> Self

Gather and advertise loopback host candidates (default false). See RtcConfiguration::ice_include_loopback_candidates.

Source

pub fn tcp_port_range(self, start: u16, end: u16) -> Self

Source

pub fn dtls_buffer_size(self, size: usize) -> Self

Source

pub fn sctp_rto_initial(self, duration: Duration) -> Self

Source

pub fn sctp_rto_min(self, duration: Duration) -> Self

Source

pub fn sctp_rto_max(self, duration: Duration) -> Self

Source

pub fn sctp_max_association_retransmits(self, count: u32) -> Self

Source

pub fn sctp_receive_window(self, size: usize) -> Self

Source

pub fn sctp_heartbeat_interval(self, duration: Duration) -> Self

Source

pub fn sctp_max_heartbeat_failures(self, count: u32) -> Self

Source

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.

Source

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.

Source

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.

Source

pub fn ice_connection_timeout(self, timeout: Duration) -> Self

Source

pub fn ice_disconnect_threshold(self, threshold: Duration) -> Self

Source

pub fn ice_disconnect_grace(self, grace: Duration) -> Self

Source

pub fn rtp_buffer_capacity(self, capacity: usize) -> Self

Source

pub fn buffer_drop_strategy(self, strategy: BufferDropStrategy) -> Self

Source

pub fn buffer_stats_log_interval(self, interval: Duration) -> Self

Source

pub fn ice_tcp_policy(self, policy: IceTcpPolicy) -> Self

Source

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.

Source

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.

Source

pub fn sdp_compatibility(self, mode: SdpCompatibilityMode) -> Self

Source

pub fn cname(self, cname: String) -> Self

Source

pub fn receiver_interceptor( self, interceptor: Arc<dyn RtpReceiverInterceptor>, ) -> Self

Append a receiver interceptor (fires on every incoming RTP packet, pre-depacketize).

Source

pub fn sender_interceptor( self, interceptor: Arc<dyn RtpSenderInterceptor>, ) -> Self

Append a sender interceptor (fires on every outgoing RTP packet, post seq/timestamp rewrite).

Source

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.

Source

pub fn build(self) -> RtcConfiguration

Trait Implementations§

Source§

impl Default for RtcConfigurationBuilder

Source§

fn default() -> Self

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

impl From<RtcConfigurationBuilder> for RtcConfiguration

Source§

fn from(builder: RtcConfigurationBuilder) -> Self

Converts to this type from the input type.

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more