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, can_gc: CanGc, ) -> Root<Dom<RTCPeerConnection>>
pub fn get_webrtc_controller(&self) -> &DomRefCell<Option<WebRtcController>>
fn make_signaller(&self) -> Box<dyn WebRtcSignaller>
fn on_ice_candidate(&self, candidate: IceCandidate, can_gc: CanGc)
fn on_negotiation_needed(&self, can_gc: CanGc)
fn on_add_stream(&self, id: MediaStreamId, ty: MediaStreamType, can_gc: CanGc)
fn on_data_channel_event( &self, channel_id: DataChannelId, event: DataChannelEvent, can_gc: CanGc, )
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, can_gc: CanGc)
fn update_gathering_state(&self, state: GatheringState, can_gc: CanGc)
sourcefn update_ice_connection_state(&self, state: IceConnectionState, can_gc: CanGc)
fn update_ice_connection_state(&self, state: IceConnectionState, can_gc: CanGc)
fn update_signaling_state(&self, state: SignalingState, can_gc: CanGc)
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>, _: CanGc) -> 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>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::rtcpeerconnection::RTCPeerConnection>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> 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>, script_runtime::CanGc) -> 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§impl PartialEq for RTCPeerConnection
impl PartialEq for RTCPeerConnection
source§impl RTCPeerConnectionMethods for RTCPeerConnection
impl RTCPeerConnectionMethods for RTCPeerConnection
source§fn AddIceCandidate(
&self,
candidate: &RTCIceCandidateInit,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn AddIceCandidate( &self, candidate: &RTCIceCandidateInit, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
source§fn CreateOffer(
&self,
_options: &RTCOfferOptions,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn CreateOffer( &self, _options: &RTCOfferOptions, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
source§fn CreateAnswer(
&self,
_options: &RTCAnswerOptions,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn CreateAnswer( &self, _options: &RTCAnswerOptions, comp: InRealm<'_>, can_gc: CanGc, ) -> 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<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn SetLocalDescription( &self, desc: &RTCSessionDescriptionInit, comp: InRealm<'_>, can_gc: CanGc, ) -> Rc<Promise>
source§fn SetRemoteDescription(
&self,
desc: &RTCSessionDescriptionInit,
comp: InRealm<'_>,
can_gc: CanGc,
) -> Rc<Promise>
fn SetRemoteDescription( &self, desc: &RTCSessionDescriptionInit, comp: InRealm<'_>, can_gc: CanGc, ) -> 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 Constructor( window: &Window, proto: Option<HandleObject<'_>>, can_gc: CanGc, config: &RTCConfiguration, ) -> Result<Root<Dom<RTCPeerConnection>>, Error>
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
impl Eq for RTCPeerConnection
Auto Trait Implementations§
impl !Freeze for RTCPeerConnection
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. 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>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
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