pub struct WebRTCManager { /* private fields */ }Expand description
WebRTC manager - handles all WebRTC peer connections WebRTC connection manager
Manages all WebRTC peer connections, handles signaling via DAM protocol, and coordinates ICE candidate exchange. Automatically maintains connection limits and handles connection lifecycle.
§Example
use gun::webrtc::{WebRTCManager, WebRTCOptions};
use gun::core::GunCore;
use gun::dam::Mesh;
use std::sync::Arc;
let core = Arc::new(GunCore::new());
let mesh = Arc::new(Mesh::new(core.clone(), /* ... */));
let options = WebRTCOptions::default();
let manager = Arc::new(WebRTCManager::new(core, mesh, options));Implementations§
Source§impl WebRTCManager
impl WebRTCManager
Sourcepub fn new(core: Arc<GunCore>, mesh: Arc<Mesh>, options: WebRTCOptions) -> Self
pub fn new(core: Arc<GunCore>, mesh: Arc<Mesh>, options: WebRTCOptions) -> Self
Create a new WebRTC manager
Sourcepub async fn handle_rtc_message(&self, msg: &Value) -> GunResult<()>
pub async fn handle_rtc_message(&self, msg: &Value) -> GunResult<()>
Handle incoming RTC signaling message from DAM protocol This is called when we receive an RTC message through the mesh
Auto Trait Implementations§
impl Freeze for WebRTCManager
impl !RefUnwindSafe for WebRTCManager
impl Send for WebRTCManager
impl Sync for WebRTCManager
impl Unpin for WebRTCManager
impl !UnwindSafe for WebRTCManager
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