pub struct WebRtcConfig {
pub advertise_on_nostr: Option<bool>,
pub auto_connect: Option<bool>,
pub accept_connections: Option<bool>,
pub mtu: Option<u16>,
pub max_connections: Option<usize>,
pub connect_timeout_ms: Option<u64>,
pub ice_gather_timeout_ms: Option<u64>,
pub data_channel_label: Option<String>,
pub ordered: Option<bool>,
pub max_retransmits: Option<u16>,
pub signal_relays: Option<Vec<String>>,
pub stun_servers: Option<Vec<String>>,
}Expand description
WebRTC transport instance configuration.
WebRTC uses Nostr gift-wrapped signaling from node.discovery.nostr and
carries ordinary FIPS datagrams over an SCTP data channel.
Fields§
§advertise_on_nostr: Option<bool>Whether this transport should be advertised on Nostr overlay discovery. Default: false.
auto_connect: Option<bool>Whether to automatically connect to discovered WebRTC peers. Default: false.
accept_connections: Option<bool>Accept inbound WebRTC offers. Default: true.
mtu: Option<u16>Data-channel MTU. Defaults to 1200.
max_connections: Option<usize>Maximum simultaneous WebRTC peer connections. Defaults to 32.
connect_timeout_ms: Option<u64>Outbound connect timeout in milliseconds. Defaults to 30000.
ice_gather_timeout_ms: Option<u64>Non-trickle ICE gathering timeout in milliseconds. Defaults to 10000.
data_channel_label: Option<String>Data channel label. Defaults to “fips”.
ordered: Option<bool>Ordered data channel delivery. Default: false.
max_retransmits: Option<u16>Maximum retransmits for partial reliability. Default: 0. Set to null/omit for the unreliable datagram-like default.
signal_relays: Option<Vec<String>>Override signaling relays for this transport. When unset,
node.discovery.nostr.dm_relays is used.
stun_servers: Option<Vec<String>>Override STUN servers for this transport. When unset,
node.discovery.nostr.stun_servers is used.
Implementations§
Source§impl WebRtcConfig
impl WebRtcConfig
Sourcepub fn advertise_on_nostr(&self) -> bool
pub fn advertise_on_nostr(&self) -> bool
Whether this WebRTC transport should be advertised on Nostr discovery.
Sourcepub fn auto_connect(&self) -> bool
pub fn auto_connect(&self) -> bool
Whether this transport auto-connects to discovered peers.
Sourcepub fn accept_connections(&self) -> bool
pub fn accept_connections(&self) -> bool
Whether this transport accepts inbound offers.
Sourcepub fn max_connections(&self) -> usize
pub fn max_connections(&self) -> usize
Get the maximum number of peer connections.
Sourcepub fn connect_timeout_ms(&self) -> u64
pub fn connect_timeout_ms(&self) -> u64
Get the connect timeout in milliseconds.
Sourcepub fn ice_gather_timeout_ms(&self) -> u64
pub fn ice_gather_timeout_ms(&self) -> u64
Get the ICE gathering timeout in milliseconds.
Sourcepub fn data_channel_label(&self) -> &str
pub fn data_channel_label(&self) -> &str
Get the data channel label.
Sourcepub fn max_retransmits(&self) -> u16
pub fn max_retransmits(&self) -> u16
Get the configured max retransmits. Default is 0.
Sourcepub fn signal_relays<'a>(&'a self, fallback: &'a [String]) -> Vec<String>
pub fn signal_relays<'a>(&'a self, fallback: &'a [String]) -> Vec<String>
Resolve signaling relays, falling back to node discovery relays.
Sourcepub fn stun_servers<'a>(&'a self, fallback: &'a [String]) -> Vec<String>
pub fn stun_servers<'a>(&'a self, fallback: &'a [String]) -> Vec<String>
Resolve STUN servers, falling back to node discovery STUN servers.
Trait Implementations§
Source§impl Clone for WebRtcConfig
impl Clone for WebRtcConfig
Source§fn clone(&self) -> WebRtcConfig
fn clone(&self) -> WebRtcConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebRtcConfig
impl Debug for WebRtcConfig
Source§impl Default for WebRtcConfig
impl Default for WebRtcConfig
Source§fn default() -> WebRtcConfig
fn default() -> WebRtcConfig
Source§impl<'de> Deserialize<'de> for WebRtcConfig
impl<'de> Deserialize<'de> for WebRtcConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WebRtcConfig
impl RefUnwindSafe for WebRtcConfig
impl Send for WebRtcConfig
impl Sync for WebRtcConfig
impl Unpin for WebRtcConfig
impl UnsafeUnpin for WebRtcConfig
impl UnwindSafe for WebRtcConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more