pub enum JsEvent<P = Payload> {
Show 23 variants
IceCandidate {
candidate: String,
sdp_mid: Option<String>,
sdp_m_line_index: Option<u16>,
username_fragment: Option<String>,
url: Option<String>,
},
IceCandidateError {
address: Option<String>,
port: Option<u16>,
url: String,
error_code: u16,
error_text: String,
},
SignalingState {
state: String,
},
IceGatheringState {
state: String,
},
IceConnectionState {
state: String,
},
ConnectionState {
state: String,
},
NegotiationNeeded,
SctpState {
state: &'static str,
},
DtlsState {
state: String,
},
DataChannelOpen {
channel: u32,
id: Option<u16>,
label: String,
protocol: String,
ordered: bool,
max_packet_life_time: Option<u16>,
max_retransmits: Option<u16>,
negotiated: bool,
priority: u16,
},
DataChannelClosing {
channel: u32,
},
DataChannelClose {
channel: u32,
},
DataChannelError {
channel: u32,
error_detail: String,
message: String,
sctp_cause_code: Option<u16>,
label: Option<String>,
id: Option<u16>,
},
DataChannelSent {
channel: u32,
bytes: f64,
},
DataChannelMessage {
channel: u32,
text: bool,
data: P,
},
TrackUnmute {
transceiver: u32,
generation: u32,
},
Rtp {
transceiver: u32,
data: P,
},
KeyFrameRequest {
transceiver: u32,
},
EncodedFrame {
transceiver: u32,
data: P,
key_frame: bool,
width: Option<u16>,
height: Option<u16>,
info: ReceivedFrameInfo,
},
TrackMute {
transceiver: u32,
},
TrackResize {
transceiver: u32,
width: u32,
height: u32,
},
MediaFrame {
transceiver: u32,
data: P,
key_frame: bool,
mime_type: String,
rtp_timestamp: u32,
width: Option<u32>,
height: Option<u32>,
},
OpDone {
op: u32,
error: Option<Error>,
},
}Expand description
An event for JavaScript, delivered in batches by Peer::next_events.
Data channels are named by their engine handle (channel), which
exists before the SCTP stream id does.
P is how a received payload is held: Payload from the engine; a
front end that hands buffers to its JavaScript without a copy swaps it
for its own buffer type with JsEvent::map_payload.
Variants§
IceCandidate
Fields
IceCandidateError
SignalingState
IceGatheringState
IceConnectionState
ConnectionState
NegotiationNeeded
SctpState
RTCSctpTransport.state, from the SCTP association.
DtlsState
The DTLS transport’s own state, as the engine has it (the peer’s
close_notify closes it while the connection stays connected).
DataChannelOpen
Fields
DataChannelClosing
DataChannelClose
DataChannelError
A data channel failed (W3C: an error event with an RTCError, then
the channel closes): the engine’s RTCError for it
(RTCPeerConnection::data_channel_error), and what names the channel.
Fields
DataChannelSent
SCTP took bytes more of the channel’s application data from its send
queue (W3C: “when the underlying data transport sends data from its
queue … reduce [[BufferedAmount]]”).
DataChannelMessage
TrackUnmute
A receiver’s first RTP packet since JavaScript last muted its track:
the track unmutes, unless JavaScript muted it again (or started
receiving again) since, which generation tells.
Rtp
An RTP packet for a Deno.webrtc.readRtp() reader (header included).
KeyFrameRequest
The remote receiver asked a sender for a key frame (PLI / FIR).
EncodedFrame
A received frame, for the receiver’s encoded transform.
TrackMute
A receiver’s RTP stopped for media_sink::SILENCE: its track mutes.
TrackResize
A receiver’s video names a new coded size (getSettings()).
MediaFrame
A received frame, for Deno.webrtc.readFrames() readers.
Fields
data: POpDone
A two-phase operation finished (Peer::set_remote_description,
Peer::add_ice_candidate): op is the id the call returned, and
error (left out on success) its failure as
{"kind": "NotCapable", "message": "..."}, kind being an
ErrorKind::name.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<P> Forget for JsEvent<P>
impl<P> Freeze for JsEvent<P>
impl<P> Move for JsEvent<P>
impl<P> RefUnwindSafe for JsEvent<P>where
P: RefUnwindSafe,
impl<P> Send for JsEvent<P>
impl<P> Sync for JsEvent<P>
impl<P> Unpin for JsEvent<P>
impl<P> UnsafeUnpin for JsEvent<P>where
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'static str: UnsafeUnpin,
P: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
impl<P> UnwindSafe for JsEvent<P>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.