Struct medea_jason::peer::sender::State
source · pub struct State { /* private fields */ }
Expand description
State of the Component
.
Implementations§
source§impl State
impl State
sourcepub 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
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.
sourcepub fn enabled(&self) -> bool
pub fn enabled(&self) -> bool
Indicates whether this Sender
’s media exchange state is in
media_exchange_state::Stable::Enabled
.
sourcepub const fn media_type(&self) -> MediaType
pub const fn media_type(&self) -> MediaType
sourcepub fn is_enabled_individual(&self) -> bool
pub fn is_enabled_individual(&self) -> bool
Returns current individual media exchange state of this State
.
sourcepub fn is_enabled_general(&self) -> bool
pub fn is_enabled_general(&self) -> bool
Returns current general media exchange state of this State
.
sourcepub fn local_stream_update_result(
&self
) -> LocalBoxFuture<'static, Result<(), Traced<UpdateLocalStreamError>>>
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.
sourcepub fn update(&self, track_patch: TrackPatchEvent)
pub fn update(&self, track_patch: TrackPatchEvent)
Updates this State
with the provided TrackPatchEvent
.
sourcepub fn is_local_stream_update_needed(&self) -> bool
pub fn is_local_stream_update_needed(&self) -> bool
Indicates whether local MediaStream
update needed for this State
.
sourcepub fn failed_local_stream_update(&self, error: Traced<UpdateLocalStreamError>)
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
.
sourcepub fn local_stream_updated(&self)
pub fn local_stream_updated(&self)
Marks an inner local_track_state
of this State
as stable.
sourcepub const fn media_kind(&self) -> MediaKind
pub const fn media_kind(&self) -> MediaKind
sourcepub const fn media_source(&self) -> MediaSourceKind
pub const fn media_source(&self) -> MediaSourceKind
Returns MediaSourceKind
of this State
.
Trait Implementations§
source§impl AsProtoState for State
impl AsProtoState for State
§type Output = Sender
type Output = Sender
medea_client_api_proto::state
into which this state can be
transformed.source§fn as_proto(&self) -> Self::Output
fn as_proto(&self) -> Self::Output
medea_client_api_proto::state
representation.source§impl MediaStateControllable for State
impl MediaStateControllable for State
source§fn media_exchange_state_controller(&self) -> Rc<MediaExchangeStateController>
fn media_exchange_state_controller(&self) -> Rc<MediaExchangeStateController>
MediaExchangeStateController
.source§fn mute_state_controller(&self) -> Rc<MuteStateController>
fn mute_state_controller(&self) -> Rc<MuteStateController>
MuteStateController
.source§fn media_state_transition_to(
&self,
desired_state: MediaState
) -> Result<(), Traced<ProhibitedStateError>>
fn media_state_transition_to( &self, desired_state: MediaState ) -> Result<(), Traced<ProhibitedStateError>>
source§fn media_exchange_state(&self) -> MediaExchangeState
fn media_exchange_state(&self) -> MediaExchangeState
MediaExchangeState
of this MediaStateControllable
.source§fn mute_state(&self) -> MuteState
fn mute_state(&self) -> MuteState
MuteState
of this MediaStateControllable
.source§fn is_subscription_needed(&self, desired_state: MediaState) -> bool
fn is_subscription_needed(&self, desired_state: MediaState) -> bool
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
fn is_track_patch_needed(&self, desired_state: MediaState) -> bool
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>>
fn when_media_state_stable( &self, desired_state: MediaState ) -> LocalBoxFuture<'static, Result<(), MediaState>>
Future
which will be resolved when MediaState
of this
MediaStateControllable
will be TransitableState::Stable
or it’s
dropped. Read moresource§impl SynchronizableState for State
impl SynchronizableState for State
§type Input = Sender
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
fn from_proto( input: Self::Input, send_constraints: &LocalTracksConstraints ) -> Self
medea_client_api_proto::state
representation.source§fn apply(&self, input: Self::Input, _: &LocalTracksConstraints)
fn apply(&self, input: Self::Input, _: &LocalTracksConstraints)
medea_client_api_proto::state
.source§impl TransceiverSide for State
impl TransceiverSide for State
source§fn source_kind(&self) -> MediaSourceKind
fn source_kind(&self) -> MediaSourceKind
MediaSourceKind
of this TransceiverSide
.source§fn is_transitable(&self) -> bool
fn is_transitable(&self) -> bool
true
if this TransceiverSide
currently can be
disabled/enabled without LocalTracksConstraints
updating.source§impl Updatable for State
impl Updatable for State
source§fn when_stabilized(&self) -> AllProcessed<'static>
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>
fn when_updated(&self) -> AllProcessed<'static>
source§fn connection_lost(&self)
fn connection_lost(&self)
Notifies State
about a RPC connection loss.
source§fn connection_recovered(&self)
fn connection_recovered(&self)
Notifies State
about a RPC connection restore.