Struct medea_jason::peer::sender::State

source ·
pub struct State { /* private fields */ }
Expand description

State of the Component.

Implementations§

source§

impl State

source

pub fn new( id: TrackId, mid: Option<String>, media_type: MediaType, media_direction: MediaDirection, muted: bool, receivers: Vec<MemberId>, send_constraints: LocalTracksConstraints, connection_mode: ConnectionMode ) -> Self

Creates new State with the provided data.

source

pub fn enabled(&self) -> bool

Indicates whether this Sender’s media exchange state is in media_exchange_state::Stable::Enabled.

source

pub const fn id(&self) -> TrackId

Returns TrackId of this State.

source

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

Returns current mid of this State.

source

pub const fn media_type(&self) -> MediaType

Returns current MediaType of this State.

source

pub fn receivers(&self) -> Vec<MemberId>

Returns current MemberIds of the Members that this State should send media data to.

source

pub fn is_enabled_individual(&self) -> bool

Returns current individual media exchange state of this State.

source

pub fn is_enabled_general(&self) -> bool

Returns current general media exchange state of this State.

source

pub fn is_muted(&self) -> bool

Returns current mute state of this State.

source

pub fn local_stream_update_result( &self ) -> LocalBoxFuture<'static, Result<(), Traced<UpdateLocalStreamError>>>

Returns Future which will be resolved once getUserMedia()/getDisplayMedia() request for this State is resolved.

source

pub fn update(&self, track_patch: TrackPatchEvent)

Updates this State with the provided TrackPatchEvent.

source

pub fn is_local_stream_update_needed(&self) -> bool

Indicates whether local MediaStream update needed for this State.

source

pub fn failed_local_stream_update(&self, error: Traced<UpdateLocalStreamError>)

Marks an inner local_track_state of this State as failed with the provided error.

source

pub fn local_stream_updated(&self)

Marks an inner local_track_state of this State as stable.

source

pub const fn media_kind(&self) -> MediaKind

Returns MediaKind of this State.

source

pub const fn media_source(&self) -> MediaSourceKind

Returns MediaSourceKind of this State.

Trait Implementations§

source§

impl AsProtoState for State

§

type Output = Sender

medea_client_api_proto::state into which this state can be transformed.
source§

fn as_proto(&self) -> Self::Output

Converts this state to the medea_client_api_proto::state representation.
source§

impl Debug for State

source§

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

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

impl From<&State> for Sender

source§

fn from(state: &State) -> Self

Converts to this type from the input type.
source§

impl MediaStateControllable for State

source§

fn media_exchange_state_controller(&self) -> Rc<MediaExchangeStateController>

Returns reference to the MediaExchangeStateController.
source§

fn mute_state_controller(&self) -> Rc<MuteStateController>

Returns a reference to the MuteStateController.
source§

fn media_state_transition_to( &self, desired_state: MediaState ) -> Result<(), Traced<ProhibitedStateError>>

source§

fn media_exchange_state(&self) -> MediaExchangeState

source§

fn mute_state(&self) -> MuteState

source§

fn is_subscription_needed(&self, desired_state: MediaState) -> bool

Indicates whether Room should subscribe to the MediaState update when updating MediaStateControllable to the provided MediaState.
source§

fn is_track_patch_needed(&self, desired_state: MediaState) -> bool

Indicates whether Room should send TrackPatchCommand to the server when updating MediaStateControllable to the provided MediaState.
source§

fn when_media_state_stable( &self, desired_state: MediaState ) -> LocalBoxFuture<'static, Result<(), MediaState>>

Returns Future which will be resolved when MediaState of this MediaStateControllable will be TransitableState::Stable or it’s dropped. Read more
source§

impl SynchronizableState for State

§

type Input = Sender

medea_client_api_proto::state by which this state can be updated.
source§

fn from_proto( input: Self::Input, send_constraints: &LocalTracksConstraints ) -> Self

Creates a new state from the medea_client_api_proto::state representation.
source§

fn apply(&self, input: Self::Input, _: &LocalTracksConstraints)

Updates this state with a provided medea_client_api_proto::state.
source§

impl TransceiverSide for State

source§

fn track_id(&self) -> TrackId

Returns TrackId of this TransceiverSide.
source§

fn kind(&self) -> MediaKind

Returns MediaKind of this TransceiverSide.
source§

fn source_kind(&self) -> MediaSourceKind

source§

fn is_transitable(&self) -> bool

Returns true if this TransceiverSide currently can be disabled/enabled without LocalTracksConstraints updating.
source§

impl Updatable for State

source§

fn when_stabilized(&self) -> AllProcessed<'static>

Returns Future resolving once media_exchange_state and mute_state are stabilized.

source§

fn when_updated(&self) -> AllProcessed<'static>

Returns Future resolving once a State update is applied onto the Sender.

source§

fn connection_lost(&self)

Notifies State about a RPC connection loss.

source§

fn connection_recovered(&self)

Notifies State about a RPC connection restore.

Auto Trait Implementations§

§

impl !RefUnwindSafe for State

§

impl !Send for State

§

impl !Sync for State

§

impl Unpin for State

§

impl !UnwindSafe for State

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.