pub struct WebRTCOptions {
pub ice_servers: Vec<RTCIceServer>,
pub data_channel: RTCDataChannelInit,
pub max_connections: usize,
pub room: Option<String>,
pub enabled: bool,
}Expand description
Configuration options for WebRTC connections
Configures ICE servers (STUN/TURN), data channel settings, and connection limits.
Matches Gun.js opt.rtc structure.
§Example
use gun::webrtc::WebRTCOptions;
use webrtc::ice_transport::ice_server::RTCIceServer;
let options = WebRTCOptions {
ice_servers: vec![RTCIceServer {
urls: vec!["stun:stun.l.google.com:19302".to_string()],
..Default::default()
}],
max_connections: 55,
enabled: true,
..Default::default()
};Fields§
§ice_servers: Vec<RTCIceServer>ICE servers for NAT traversal (STUN/TURN)
data_channel: RTCDataChannelInitData channel configuration
max_connections: usizeMaximum number of WebRTC connections (default 55, matching Gun.js)
room: Option<String>Room name for peer discovery (optional)
enabled: boolEnable WebRTC (default true)
Trait Implementations§
Source§impl Clone for WebRTCOptions
impl Clone for WebRTCOptions
Source§fn clone(&self) -> WebRTCOptions
fn clone(&self) -> WebRTCOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WebRTCOptions
impl Debug for WebRTCOptions
Auto Trait Implementations§
impl Freeze for WebRTCOptions
impl RefUnwindSafe for WebRTCOptions
impl Send for WebRTCOptions
impl Sync for WebRTCOptions
impl Unpin for WebRTCOptions
impl UnwindSafe for WebRTCOptions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more