PeerConnection

Struct PeerConnection 

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

Implementations§

Source§

impl PeerConnection

Source

pub fn set_configuration( &self, config: RtcConfiguration, ) -> Result<(), Exception>

Source

pub fn create_offer( &self, options: RtcOfferAnswerOptions, ctx: Box<PeerContext>, on_success: fn(ctx: Box<PeerContext>, sdp: UniquePtr<SessionDescription>), on_error: fn(ctx: Box<PeerContext>, error: RtcError), )

Source

pub fn create_answer( &self, options: RtcOfferAnswerOptions, ctx: Box<PeerContext>, on_success: fn(ctx: Box<PeerContext>, sdp: UniquePtr<SessionDescription>), on_error: fn(ctx: Box<PeerContext>, error: RtcError), )

Source

pub fn set_local_description( &self, desc: UniquePtr<SessionDescription>, ctx: Box<PeerContext>, on_complete: fn(ctx: Box<PeerContext>, error: RtcError), )

Source

pub fn set_remote_description( &self, desc: UniquePtr<SessionDescription>, ctx: Box<PeerContext>, on_complete: fn(ctx: Box<PeerContext>, error: RtcError), )

Source

pub fn add_track( &self, track: SharedPtr<MediaStreamTrack>, stream_ids: &Vec<String>, ) -> Result<SharedPtr<RtpSender>, Exception>

Source

pub fn remove_track( &self, sender: SharedPtr<RtpSender>, ) -> Result<(), Exception>

Source

pub fn get_stats( &self, ctx: Box<PeerContext>, on_stats: fn(ctx: Box<PeerContext>, json: String), )

Source

pub fn add_transceiver( &self, track: SharedPtr<MediaStreamTrack>, init: RtpTransceiverInit, ) -> Result<SharedPtr<RtpTransceiver>, Exception>

Source

pub fn add_transceiver_for_media( &self, media_type: MediaType, init: RtpTransceiverInit, ) -> Result<SharedPtr<RtpTransceiver>, Exception>

Source

pub fn get_senders(&self) -> Vec<RtpSenderPtr>

Source

pub fn get_receivers(&self) -> Vec<RtpReceiverPtr>

Source

pub fn get_transceivers(&self) -> Vec<RtpTransceiverPtr>

Source

pub fn create_data_channel( &self, label: String, init: DataChannelInit, ) -> Result<SharedPtr<DataChannel>, Exception>

Source

pub fn add_ice_candidate( &self, candidate: SharedPtr<IceCandidate>, ctx: Box<PeerContext>, on_complete: fn(ctx: Box<PeerContext>, error: RtcError), )

Source

pub fn restart_ice(&self)

Source

pub fn current_local_description(&self) -> UniquePtr<SessionDescription>

Source

pub fn current_remote_description(&self) -> UniquePtr<SessionDescription>

Source

pub fn connection_state(&self) -> PeerConnectionState

Source

pub fn signaling_state(&self) -> SignalingState

Source

pub fn ice_gathering_state(&self) -> IceGatheringState

Source

pub fn ice_connection_state(&self) -> IceConnectionState

Source

pub fn close(&self)

Trait Implementations§

Source§

impl ExternType for PeerConnection

Source§

type Kind = Opaque

Source§

type Id

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

impl Send for PeerConnection

Source§

impl SharedPtrTarget for PeerConnection

Source§

impl Sync for PeerConnection

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<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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.