Enum Event

Source
#[non_exhaustive]
pub enum Event {
Show 16 variants Connected, IceConnectionStateChange(IceConnectionState), MediaAdded(MediaAdded), MediaData(MediaData), MediaChanged(MediaChanged), ChannelOpen(ChannelId, String), ChannelData(ChannelData), ChannelClose(ChannelId), PeerStats(PeerStats), MediaIngressStats(MediaIngressStats), MediaEgressStats(MediaEgressStats), EgressBitrateEstimate(BweKind), KeyframeRequest(KeyframeRequest), StreamPaused(StreamPaused), RtpPacket(RtpPacket), RawPacket(Box<RawPacket>),
}
Expand description

Events produced by Rtc::poll_output().

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Connected

Emitted when we got ICE connection and established DTLS.

§

IceConnectionStateChange(IceConnectionState)

ICE connection state changes tells us whether the Rtc instance is connected to the peer or not.

§

MediaAdded(MediaAdded)

Upon adding new media to the session. The lines are emitted.

Upon this event, the Media instance is available via Rtc::media().

§

MediaData(MediaData)

Incoming media data sent by the remote peer.

§

MediaChanged(MediaChanged)

Changes to the media may be emitted.

. Currently only covers a change of direction.

§

ChannelOpen(ChannelId, String)

A data channel has opened.

The string is the channel label which is set by the opening peer and can be used to identify the purpose of the channel when there are more than one.

The negotiation is to set up an SCTP association via DTLS. Subsequent data channels reuse the same association.

Upon this event, the Channel can be obtained via Rtc::channel().

For SdpApi: The first ever data channel results in an SDP negotiation, and this events comes at the end of that.

§

ChannelData(ChannelData)

Incoming data channel data from the remote peer.

§

ChannelClose(ChannelId)

A data channel has been closed.

§

PeerStats(PeerStats)

Statistics event for the Rtc instance

Includes both media traffic (rtp payload) as well as all traffic

§

MediaIngressStats(MediaIngressStats)

Aggregated statistics for each media (mid, rid) in the ingress direction

§

MediaEgressStats(MediaEgressStats)

Aggregated statistics for each media (mid, rid) in the egress direction

§

EgressBitrateEstimate(BweKind)

A new estimate from the bandwidth estimation subsystem.

§

KeyframeRequest(KeyframeRequest)

Incoming keyframe request for media that we are sending to the remote peer.

The request is either PLI (Picture Loss Indication) or FIR (Full Intra Request).

§

StreamPaused(StreamPaused)

Whether an incoming encoded stream is paused.

This means the stream has not received any data for some time (default 1.5 seconds).

§

RtpPacket(RtpPacket)

Incoming RTP data.

§

RawPacket(Box<RawPacket>)

Debug output of incoming and outgoing RTCP/RTP packets.

Enable using RtcConfig::enable_raw_packets(). This clones data, and is therefore expensive. Should not be enabled outside of tests and troubleshooting.

Implementations§

Source§

impl Event

Source

pub fn as_raw_packet(&self) -> Option<&RawPacket>

Reference to the RawPacket if this is indeed an Event::RawPacket.

Trait Implementations§

Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Event

Auto Trait Implementations§

§

impl Freeze for Event

§

impl !RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more