[][src]Struct mediasoup::consumer::Consumer

pub struct Consumer { /* fields omitted */ }

Implementations

impl Consumer[src]

pub fn id(&self) -> ConsumerId[src]

Consumer id.

pub fn producer_id(&self) -> ProducerId[src]

Associated Producer id.

pub fn kind(&self) -> MediaKind[src]

Media kind.

pub fn rtp_parameters(&self) -> &RtpParameters[src]

RTP parameters.

pub fn type(&self) -> ConsumerType[src]

Consumer type.

pub fn paused(&self) -> bool[src]

Whether the Consumer is paused.

pub fn producer_paused(&self) -> bool[src]

Whether the associate Producer is paused.

pub fn priority(&self) -> u8[src]

Current priority.

pub fn score(&self) -> ConsumerScore[src]

Consumer score.

pub fn preferred_layers(&self) -> Option<ConsumerLayers>[src]

Preferred video layers.

pub fn current_layers(&self) -> Option<ConsumerLayers>[src]

Current video layers.

pub fn app_data(&self) -> &AppData[src]

App custom data.

pub async fn get_stats<'_>(&'_ self) -> Result<ConsumerStats, RequestError>[src]

Get Consumer stats.

pub async fn pause<'_>(&'_ self) -> Result<(), RequestError>[src]

Pause the Consumer.

pub async fn resume<'_>(&'_ self) -> Result<(), RequestError>[src]

Resume the Consumer.

pub async fn set_preferred_layers<'_>(
    &'_ self,
    consumer_layers: ConsumerLayers
) -> Result<(), RequestError>
[src]

Set preferred video layers.

pub async fn set_priority<'_>(
    &'_ self,
    priority: u8
) -> Result<(), RequestError>
[src]

Set priority.

pub async fn unset_priority<'_>(&'_ self) -> Result<(), RequestError>[src]

Unset priority.

pub async fn request_key_frame<'_>(&'_ self) -> Result<(), RequestError>[src]

Request a key frame to the Producer.

pub async fn enable_trace_event<'_>(
    &'_ self,
    types: Vec<ConsumerTraceEventType>
) -> Result<(), RequestError>
[src]

Enable 'trace' event.

pub fn on_rtp<F: Fn(&Bytes) + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_pause<F: Fn() + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_resume<F: Fn() + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_producer_pause<F: Fn() + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_producer_resume<F: Fn() + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_score<F: Fn(&ConsumerScore) + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_layers_change<F: Fn(&ConsumerLayers) + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_trace<F: Fn(&ConsumerTraceEventData) + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_producer_close<F: FnOnce() + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

pub fn on_close<F: FnOnce() + Send + 'static>(
    &self,
    callback: F
) -> HandlerId<'static>
[src]

Trait Implementations

impl Clone for Consumer[src]

Auto Trait Implementations

impl !RefUnwindSafe for Consumer

impl Send for Consumer

impl Sync for Consumer

impl Unpin for Consumer

impl !UnwindSafe for Consumer

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, U> Into<U> for T where
    U: From<T>, 
[src]

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>,