Struct script::dom::rtcpeerconnection::RTCPeerConnection
source · #[repr(C)]pub struct RTCPeerConnection {
eventtarget: EventTarget,
controller: DomRefCell<Option<WebRtcController>>,
closed: Cell<bool>,
offer_answer_generation: Cell<u32>,
offer_promises: DomRefCell<Vec<Rc<Promise>>>,
answer_promises: DomRefCell<Vec<Rc<Promise>>>,
local_description: MutNullableDom<RTCSessionDescription>,
remote_description: MutNullableDom<RTCSessionDescription>,
gathering_state: Cell<RTCIceGatheringState>,
ice_connection_state: Cell<RTCIceConnectionState>,
signaling_state: Cell<RTCSignalingState>,
data_channels: DomRefCell<HashMap<DataChannelId, Dom<RTCDataChannel>>>,
}
Fields§
§eventtarget: EventTarget
§controller: DomRefCell<Option<WebRtcController>>
§closed: Cell<bool>
§offer_answer_generation: Cell<u32>
§offer_promises: DomRefCell<Vec<Rc<Promise>>>
§answer_promises: DomRefCell<Vec<Rc<Promise>>>
§local_description: MutNullableDom<RTCSessionDescription>
§remote_description: MutNullableDom<RTCSessionDescription>
§gathering_state: Cell<RTCIceGatheringState>
§ice_connection_state: Cell<RTCIceConnectionState>
§signaling_state: Cell<RTCSignalingState>
§data_channels: DomRefCell<HashMap<DataChannelId, Dom<RTCDataChannel>>>
Implementations§
source§impl RTCPeerConnection
impl RTCPeerConnection
fn __assert_parent_type(&self)
source§impl RTCPeerConnection
impl RTCPeerConnection
pub fn new_inherited() -> RTCPeerConnection
fn new(
global: &GlobalScope,
proto: Option<HandleObject<'_>>,
config: &RTCConfiguration
) -> Root<Dom<RTCPeerConnection>>
pub fn Constructor(
window: &Window,
proto: Option<HandleObject<'_>>,
config: &RTCConfiguration
) -> Result<Root<Dom<RTCPeerConnection>>, Error>
pub fn get_webrtc_controller(&self) -> &DomRefCell<Option<WebRtcController>>
fn make_signaller(&self) -> Box<dyn WebRtcSignaller>
fn on_ice_candidate(&self, candidate: IceCandidate)
fn on_negotiation_needed(&self)
fn on_add_stream(&self, id: MediaStreamId, ty: MediaStreamType)
fn on_data_channel_event(
&self,
channel_id: DataChannelId,
event: DataChannelEvent
)
pub fn register_data_channel(&self, id: DataChannelId, channel: &RTCDataChannel)
pub fn unregister_data_channel(&self, id: &DataChannelId)
sourcefn update_gathering_state(&self, state: GatheringState)
fn update_gathering_state(&self, state: GatheringState)
https://www.w3.org/TR/webrtc/#update-ice-gathering-state
sourcefn update_ice_connection_state(&self, state: IceConnectionState)
fn update_ice_connection_state(&self, state: IceConnectionState)
https://www.w3.org/TR/webrtc/#update-ice-connection-state
fn update_signaling_state(&self, state: SignalingState)
fn create_offer(&self)
fn create_answer(&self)
Trait Implementations§
source§impl Castable for RTCPeerConnection
impl Castable for RTCPeerConnection
source§impl DomObject for RTCPeerConnection
impl DomObject for RTCPeerConnection
source§impl DomObjectWrap for RTCPeerConnection
impl DomObjectWrap for RTCPeerConnection
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::RTCPeerConnectionBinding::RTCPeerConnectionBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::rtcpeerconnection::RTCPeerConnection>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::rtcpeerconnection::RTCPeerConnection>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::RTCPeerConnectionBinding::RTCPeerConnectionBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::rtcpeerconnection::RTCPeerConnection>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::rtcpeerconnection::RTCPeerConnection>>}
source§impl HasParent for RTCPeerConnection
impl HasParent for RTCPeerConnection
source§fn as_parent(&self) -> &EventTarget
fn as_parent(&self) -> &EventTarget
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = EventTarget
source§impl IDLInterface for RTCPeerConnection
impl IDLInterface for RTCPeerConnection
source§impl MallocSizeOf for RTCPeerConnection
impl MallocSizeOf for RTCPeerConnection
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MutDomObject for RTCPeerConnection
impl MutDomObject for RTCPeerConnection
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
source§impl PartialEq<RTCPeerConnection> for RTCPeerConnection
impl PartialEq<RTCPeerConnection> for RTCPeerConnection
source§fn eq(&self, other: &RTCPeerConnection) -> bool
fn eq(&self, other: &RTCPeerConnection) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl RTCPeerConnectionMethods for RTCPeerConnection
impl RTCPeerConnectionMethods for RTCPeerConnection
source§fn AddIceCandidate(
&self,
candidate: &RTCIceCandidateInit,
comp: InRealm<'_>
) -> Rc<Promise>
fn AddIceCandidate(
&self,
candidate: &RTCIceCandidateInit,
comp: InRealm<'_>
) -> Rc<Promise>
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addicecandidate
source§fn CreateOffer(
&self,
_options: &RTCOfferOptions,
comp: InRealm<'_>
) -> Rc<Promise>
fn CreateOffer(
&self,
_options: &RTCOfferOptions,
comp: InRealm<'_>
) -> Rc<Promise>
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer
source§fn CreateAnswer(
&self,
_options: &RTCAnswerOptions,
comp: InRealm<'_>
) -> Rc<Promise>
fn CreateAnswer(
&self,
_options: &RTCAnswerOptions,
comp: InRealm<'_>
) -> Rc<Promise>
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer
source§fn GetLocalDescription(&self) -> Option<Root<Dom<RTCSessionDescription>>>
fn GetLocalDescription(&self) -> Option<Root<Dom<RTCSessionDescription>>>
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-localdescription
source§fn GetRemoteDescription(&self) -> Option<Root<Dom<RTCSessionDescription>>>
fn GetRemoteDescription(&self) -> Option<Root<Dom<RTCSessionDescription>>>
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-remotedescription
source§fn SetLocalDescription(
&self,
desc: &RTCSessionDescriptionInit,
comp: InRealm<'_>
) -> Rc<Promise>
fn SetLocalDescription(
&self,
desc: &RTCSessionDescriptionInit,
comp: InRealm<'_>
) -> Rc<Promise>
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setlocaldescription
source§fn SetRemoteDescription(
&self,
desc: &RTCSessionDescriptionInit,
comp: InRealm<'_>
) -> Rc<Promise>
fn SetRemoteDescription(
&self,
desc: &RTCSessionDescriptionInit,
comp: InRealm<'_>
) -> Rc<Promise>
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setremotedescription
source§fn IceGatheringState(&self) -> RTCIceGatheringState
fn IceGatheringState(&self) -> RTCIceGatheringState
https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-icegatheringstate
source§fn IceConnectionState(&self) -> RTCIceConnectionState
fn IceConnectionState(&self) -> RTCIceConnectionState
https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-iceconnectionstate
source§fn SignalingState(&self) -> RTCSignalingState
fn SignalingState(&self) -> RTCSignalingState
https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-signalingstate
source§fn CreateDataChannel(
&self,
label: USVString,
init: &RTCDataChannelInit
) -> Root<Dom<RTCDataChannel>>
fn CreateDataChannel(
&self,
label: USVString,
init: &RTCDataChannelInit
) -> Root<Dom<RTCDataChannel>>
https://www.w3.org/TR/webrtc/#dom-peerconnection-createdatachannel
source§fn AddTransceiver(
&self,
_track_or_kind: MediaStreamTrackOrString,
init: &RTCRtpTransceiverInit
) -> Root<Dom<RTCRtpTransceiver>>
fn AddTransceiver(
&self,
_track_or_kind: MediaStreamTrackOrString,
init: &RTCRtpTransceiverInit
) -> Root<Dom<RTCRtpTransceiver>>
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver