Struct medea_jason::peer::TransitableStateController [−][src]
Component managing all kinds of TransitableState
.
Implementations
impl<S, T> TransitableStateController<S, T> where
S: InStable<Transition = T> + Into<TransitableState<S, T>> + 'static,
T: InTransition<Stable = S> + Into<TransitableState<S, T>> + 'static,
[src]
S: InStable<Transition = T> + Into<TransitableState<S, T>> + 'static,
T: InTransition<Stable = S> + Into<TransitableState<S, T>> + 'static,
#[must_use]pub fn new(state: S) -> Rc<Self>
[src]
Returns new TransitableStateController
with the provided
stable state.
pub fn subscribe_stable(&self) -> LocalBoxStream<'static, S>
[src]
Returns Stream
into which the TransitableState::Stable
updates
will be emitted.
pub fn subscribe_transition(&self) -> LocalBoxStream<'static, T>
[src]
Returns Stream
into which the TransitableState::Transition
updates will be emitted.
pub fn stop_transition_timeout(&self)
[src]
Stops disable/enable timeout of this TransitableStateController
.
pub fn reset_transition_timeout(&self)
[src]
Resets disable/enable timeout of this TransitableStateController
.
#[must_use]pub fn state(&self) -> TransitableState<S, T>
[src]
Returns current TransitableStateController::state
.
pub fn transition_to(&self, desired_state: S)
[src]
Starts transition of the TransitableStateController::state
to the
provided one.
pub fn when_media_state_stable(
&self,
desired_state: S
) -> LocalBoxFuture<'static, Result<(), Traced<MediaConnectionsError>>>
[src]
&self,
desired_state: S
) -> LocalBoxFuture<'static, Result<(), Traced<MediaConnectionsError>>>
Returns Future
which will be resolved when state of this
TransitableStateController
will be TransitableState::Stable
or
the TransitableStateController
is dropped.
Succeeds if TransitableStateController
’s state transits into the
desired_state
or the TransitableStateController
is dropped.
Errors
MediaConnectionsError::MediaStateTransitsIntoOppositeState
is returned if TransitableStateController
’s MediaState
transits
into the opposite to the desired_state
.
pub fn when_processed(&self) -> Processed<'static>
[src]
Returns Processed
that will be resolved once all the underlying data
updates are processed by all subscribers.
pub fn when_stabilized(self: Rc<Self>) -> Processed<'static, ()>
[src]
Returns Future
which will be resolved once TransitableState
is
transited to the TransitableState::Stable
.
impl TransitableStateController<Stable, Transition>
[src]
#[must_use]pub fn muted(&self) -> bool
[src]
Indicates whether TransitableStateController
’s mute state is in
mute_state::Stable::Muted
.
#[must_use]pub fn unmuted(&self) -> bool
[src]
Indicates whether TransitableStateController
’s mute state is in
mute_state::Stable::Unmuted
.
impl TransitableStateController<Stable, Transition>
[src]
#[must_use]pub fn disabled(&self) -> bool
[src]
Indicates whether TransitableStateController
’s media exchange state
is in media_exchange_state::Stable::Disabled
.
#[must_use]pub fn enabled(&self) -> bool
[src]
Indicates whether TransitableStateController
’s media exchange state
is in media_exchange_state::Stable::Enabled
.
Trait Implementations
impl<S: Debug, T: Debug> Debug for TransitableStateController<S, T>
[src]
Auto Trait Implementations
impl<S, T> !RefUnwindSafe for TransitableStateController<S, T>
impl<S, T> !Send for TransitableStateController<S, T>
impl<S, T> !Sync for TransitableStateController<S, T>
impl<S, T> Unpin for TransitableStateController<S, T> where
S: Unpin,
T: Unpin,
S: Unpin,
T: Unpin,
impl<S, T> !UnwindSafe for TransitableStateController<S, T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.