pub struct PeerConnection { /* private fields */ }
Implementations§
Source§impl PeerConnection
impl PeerConnection
pub fn new(configuration: Configuration) -> Result<Self, Error>
pub fn close(&self)
pub async fn create_offer(&self) -> Result<Description, Error>
pub async fn create_answer(&self) -> Result<Description, Error>
pub async fn set_local_description( &self, description: &Description, ) -> Result<(), Error>
pub async fn set_remote_description( &self, description: &Description, ) -> Result<(), Error>
pub fn create_data_channel( &self, label: &str, options: DataChannelOptions, ) -> Result<DataChannel, Error>
pub fn set_on_ice_candidate( &self, cb: Option<impl Fn(Option<&str>) + Send + Sync + 'static>, )
pub fn set_on_ice_gathering_state_change( &self, cb: Option<impl Fn(IceGatheringState) + Send + Sync + 'static>, )
pub fn set_on_connection_state_change( &self, cb: Option<impl Fn(PeerConnectionState) + Send + Sync + 'static>, )
pub fn set_on_data_channel( &self, cb: Option<impl Fn(DataChannel) + Send + Sync + 'static>, )
pub fn local_description(&self) -> Option<Description>
pub fn remote_description(&self) -> Option<Description>
pub async fn add_ice_candidate(&self, cand: Option<&str>) -> Result<(), Error>
Trait Implementations§
Source§impl Drop for PeerConnection
impl Drop for PeerConnection
impl Send for PeerConnection
impl Sync for PeerConnection
Auto Trait Implementations§
impl Freeze for PeerConnection
impl RefUnwindSafe for PeerConnection
impl Unpin for PeerConnection
impl UnwindSafe for PeerConnection
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
Mutably borrows from an owned value. Read more