Enum songbird::EventContext[][src]

#[non_exhaustive]pub enum EventContext<'a> {
    Track(&'a [(&'a TrackState, &'a TrackHandle)]),
    SpeakingStateUpdate(Speaking),
    SpeakingUpdate {
        ssrc: u32,
        speaking: bool,
    },
    VoicePacket {
        audio: &'a Option<Vec<i16>>,
        packet: &'a Rtp,
        payload_offset: usize,
        payload_end_pad: usize,
    },
    RtcpPacket {
        packet: &'a Rtcp,
        payload_offset: usize,
        payload_end_pad: usize,
    },
    ClientConnect(ClientConnect),
    ClientDisconnect(ClientDisconnect),
    DriverConnect,
    DriverReconnect,
    DriverConnectFailed,
    DriverReconnectFailed,
    SsrcKnown(u32),
}

Information about which tracks or data fired an event.

Track events may be local or global, and have no tracks if fired on the global context via Driver::add_global_event.

Variants (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.

Track event context, passed to events created via TrackHandle::add_event, EventStore::add_event, or relevant global events.

SpeakingStateUpdate(Speaking)

Speaking state update, typically describing how another voice user is transmitting audio data. Clients must send at least one such packet to allow SSRC/UserID matching.

SpeakingUpdate

Speaking state transition, describing whether a given source has started/stopped transmitting. This fires in response to a silent burst, or the first packet breaking such a burst.

Fields of SpeakingUpdate

ssrc: u32

Synchronisation Source of the user who has begun speaking.

This must be combined with another event class to map this back to its original UserId.

speaking: bool

Whether this user is currently speaking.

VoicePacket

Opus audio packet, received from another stream (detailed in packet). payload_offset contains the true payload location within the raw packet's payload(), if extensions or raw packet data are required. if audio.len() == 0, then this packet arrived out-of-order.

Fields of VoicePacket

audio: &'a Option<Vec<i16>>

Decoded audio from this packet.

packet: &'a Rtp

Raw RTP packet data.

Includes the SSRC (i.e., sender) of this packet.

payload_offset: usize

Byte index into the packet body (after headers) for where the payload begins.

payload_end_pad: usize

Number of bytes at the end of the packet to discard.

RtcpPacket

Telemetry/statistics packet, received from another stream (detailed in packet). payload_offset contains the true payload location within the raw packet's payload(), to allow manual decoding of Rtcp packet bodies.

Fields of RtcpPacket

packet: &'a Rtcp

Raw RTCP packet data.

payload_offset: usize

Byte index into the packet body (after headers) for where the payload begins.

payload_end_pad: usize

Number of bytes at the end of the packet to discard.

ClientConnect(ClientConnect)

Fired whenever a client connects to a call for the first time, allowing SSRC/UserID matching.

ClientDisconnect(ClientDisconnect)

Fired whenever a client disconnects.

DriverConnect

Fires when this driver successfully connects to a voice channel.

DriverReconnect

Fires when this driver successfully reconnects after a network error.

DriverConnectFailed

Fires when this driver fails to connect to a voice channel.

DriverReconnectFailed

Fires when this driver fails to reconnect to a voice channel after a network error.

Users will need to manually reconnect on receipt of this error.

SsrcKnown(u32)

Fires whenever the driver is assigned a new RTP SSRC by the voice server.

This typically fires alongside a DriverConnect, or a full DriverReconnect.

Implementations

impl EventContext<'_>[src]

pub fn to_core_event(&self) -> Option<CoreEvent>[src]

Retreive the event class for an event (i.e., when matching) an event against the registered listeners.

Trait Implementations

impl<'a> Clone for EventContext<'a>[src]

impl<'a> Debug for EventContext<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for EventContext<'a>[src]

impl<'a> Send for EventContext<'a>[src]

impl<'a> Sync for EventContext<'a>[src]

impl<'a> Unpin for EventContext<'a>[src]

impl<'a> !UnwindSafe for EventContext<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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

impl<T> WithSubscriber for T[src]