pub struct Receiver { /* private fields */ }
Expand description

Representation of a remote::Track that is being received from some remote peer. It may have two states: waiting and receiving.

We can save related platform::Transceiver and the actual remote::Track only when remote::Track data arrives.

Implementations§

source§

impl Receiver

source

pub async fn new( state: &State, media_connections: &MediaConnections, track_events_sender: UnboundedSender<TrackEvent>, recv_constraints: &RecvConstraints, connection_mode: ConnectionMode ) -> Self

Creates a new platform::Transceiver if provided mid is None, otherwise creates a Receiver without a platform::Transceiver. It will be injected when a remote::Track will arrive.

Created platform::Transceiver direction is set to TransceiverDirection::INACTIVE if enabled_individual is false.

track field in the created Receiver will be None, since Receiver must be created before the actual remote::Track data arrives.

source

pub const fn caps(&self) -> &TrackConstraints

Returns TrackConstraints of this Receiver.

source

pub fn mid(&self) -> Option<String>

Returns mid of this Receiver.

source

pub async fn is_receiving(&self) -> bool

Indicates whether this Receiver receives media data.

source

pub fn send_media_exchange_state_intention(&self, state: Transition)

source

pub async fn set_remote_track( &self, transceiver: Transceiver, new_track: MediaStreamTrack )

Adds the provided platform::MediaStreamTrack and platform::Transceiver to this Receiver.

Sets platform::MediaStreamTrack::enabled same as enabled_individual of this Receiver.

source

pub fn set_media_direction(&self, direction: MediaDirection)

Updates MediaDirection of this Receiver.

source

pub fn set_transceiver(&self, transceiver: Transceiver)

Replaces Receiver’s platform::Transceiver with the provided platform::Transceiver.

Doesn’t update platform::TransceiverDirection of the platform::Transceiver.

No-op if provided with the same platform::Transceiver as already exists in this Receiver.

source

pub fn transceiver(&self) -> Option<Transceiver>

Returns a platform::Transceiver of this Receiver.

Returns None if this Receiver doesn’t have a platform::Transceiver.

Trait Implementations§

source§

impl Debug for Receiver

source§

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

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

impl Drop for Receiver

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V

source§

impl<E> WrapTraced<E> for E

source§

fn wrap_traced(self, f: Frame) -> Traced<E>

Wraps this error into a Traced wrapper, storing the given Frame of a Trace inside.