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)
sourcefn update_ice_connection_state(&self, state: IceConnectionState)
fn update_ice_connection_state(&self, state: IceConnectionState)
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::RTCPeerConnection_Binding::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::RTCPeerConnection_Binding::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>>}
Function pointer to the general wrap function type
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
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
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)
Initializes the Reflector
source§impl PartialEq<RTCPeerConnection> for RTCPeerConnection
impl PartialEq<RTCPeerConnection> for RTCPeerConnection
source§fn eq(&self, other: &RTCPeerConnection) -> bool
fn eq(&self, other: &RTCPeerConnection) -> bool
This method tests for
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>
source§fn CreateOffer(
&self,
_options: &RTCOfferOptions,
comp: InRealm<'_>
) -> Rc<Promise>
fn CreateOffer( &self, _options: &RTCOfferOptions, comp: InRealm<'_> ) -> Rc<Promise>
source§fn CreateAnswer(
&self,
_options: &RTCAnswerOptions,
comp: InRealm<'_>
) -> Rc<Promise>
fn CreateAnswer( &self, _options: &RTCAnswerOptions, comp: InRealm<'_> ) -> Rc<Promise>
source§fn GetLocalDescription(&self) -> Option<Root<Dom<RTCSessionDescription>>>
fn GetLocalDescription(&self) -> Option<Root<Dom<RTCSessionDescription>>>
source§fn GetRemoteDescription(&self) -> Option<Root<Dom<RTCSessionDescription>>>
fn GetRemoteDescription(&self) -> Option<Root<Dom<RTCSessionDescription>>>
source§fn SetLocalDescription(
&self,
desc: &RTCSessionDescriptionInit,
comp: InRealm<'_>
) -> Rc<Promise>
fn SetLocalDescription( &self, desc: &RTCSessionDescriptionInit, comp: InRealm<'_> ) -> Rc<Promise>
source§fn SetRemoteDescription(
&self,
desc: &RTCSessionDescriptionInit,
comp: InRealm<'_>
) -> Rc<Promise>
fn SetRemoteDescription( &self, desc: &RTCSessionDescriptionInit, comp: InRealm<'_> ) -> Rc<Promise>
source§fn IceGatheringState(&self) -> RTCIceGatheringState
fn IceGatheringState(&self) -> RTCIceGatheringState
source§fn IceConnectionState(&self) -> RTCIceConnectionState
fn IceConnectionState(&self) -> RTCIceConnectionState
source§fn SignalingState(&self) -> RTCSignalingState
fn SignalingState(&self) -> RTCSignalingState
source§fn CreateDataChannel(
&self,
label: USVString,
init: &RTCDataChannelInit
) -> Root<Dom<RTCDataChannel>>
fn CreateDataChannel( &self, label: USVString, init: &RTCDataChannelInit ) -> Root<Dom<RTCDataChannel>>
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>>
fn GetOnicecandidate(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnicecandidate(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOntrack(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOntrack(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOniceconnectionstatechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOniceconnectionstatechange( &self, listener: Option<Rc<EventHandlerNonNull>> )
fn GetOnicegatheringstatechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnicegatheringstatechange( &self, listener: Option<Rc<EventHandlerNonNull>> )
fn GetOnnegotiationneeded(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnnegotiationneeded(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOnsignalingstatechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnsignalingstatechange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn GetOndatachannel(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOndatachannel(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn AddStream(&self, stream: &MediaStream)
source§impl Traceable for RTCPeerConnection
impl Traceable for RTCPeerConnection
impl DerivedFrom<EventTarget> for RTCPeerConnection
Auto Trait Implementations§
impl !RefUnwindSafe for RTCPeerConnection
impl !Send for RTCPeerConnection
impl !Sync for RTCPeerConnection
impl Unpin for RTCPeerConnection
impl !UnwindSafe for RTCPeerConnection
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert