Struct medea_jason::peer::TransitableStateController[][src]

pub struct TransitableStateController<S, T> { /* fields omitted */ }

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]

#[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]

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]

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

impl<S, T> !UnwindSafe for TransitableStateController<S, T>

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, 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<E> WrapTraced<E> for E[src]