Struct medea_jason::peer::State[][src]

pub struct State { /* fields omitted */ }

State of a Component.

Implementations

impl State[src]

#[must_use]pub fn new(
    id: Id,
    ice_servers: Vec<IceServer>,
    force_relay: bool,
    negotiation_role: Option<NegotiationRole>
) -> Self
[src]

Creates a new State with the provided data.

#[must_use]pub fn id(&self) -> Id[src]

Returns Id of this State.

#[must_use]pub fn ice_servers(&self) -> &Vec<IceServer>[src]

Returns all IceServers of this State.

#[must_use]pub fn force_relay(&self) -> bool[src]

Indicates whether PeerConnection should be relayed forcibly.

pub fn insert_sender(&self, track_id: TrackId, sender: Rc<State>)[src]

Inserts a new sender::State into this State.

pub fn insert_receiver(&self, track_id: TrackId, receiver: Rc<State>)[src]

Inserts a new receiver::State into this State.

#[must_use]pub fn get_sender(&self, track_id: TrackId) -> Option<Rc<State>>[src]

Returns Rc to the sender::State with the provided TrackId.

#[must_use]pub fn get_receiver(&self, track_id: TrackId) -> Option<Rc<State>>[src]

Returns Rc to the receiver::State with the provided TrackId.

pub async fn set_negotiation_role(&self, negotiation_role: NegotiationRole)[src]

Sets NegotiationRole of this State to the provided one.

pub fn restart_ice(&self)[src]

Sets State::restart_ice to true.

pub fn remove_track(&self, track_id: TrackId)[src]

Removes sender::State or receiver::State with the provided TrackId.

pub fn set_remote_sdp(&self, sdp: String)[src]

Sets remote SDP offer to the provided value.

pub fn add_ice_candidate(&self, ice_candidate: IceCandidate)[src]

Adds IceCandidate for the State.

pub fn apply_local_sdp(&self, sdp: String)[src]

Marks current local SDP as approved by server.

pub fn stop_timeouts(&self)[src]

Stops all timeouts of the State.

Stops local SDP rollback timeout.

pub fn resume_timeouts(&self)[src]

Resumes all timeouts of the State.

Resumes local SDP rollback timeout.

pub fn local_stream_update_result(
    &self,
    tracks_ids: HashSet<TrackId>
) -> LocalBoxFuture<'static, Result<(), Traced<PeerError>>>
[src]

Returns Future resolving once getUserMedia()/getDisplayMedia() request for the provided TrackIds is resolved.

Result returned by this Future will be the same as the result of the getUserMedia()/getDisplayMedia() request.

Returns last known getUserMedia()/getDisplayMedia() request’s Result, if currently no such requests are running for the provided TrackIds.

pub fn when_all_updated(&self) -> AllProcessed<'static>[src]

Returns Future resolving when all sender::State’s and receiver::State’s updates will be applied.

pub fn insert_track(
    &self,
    track: &Track,
    send_constraints: LocalTracksConstraints
) -> Result<(), Traced<PeerError>>
[src]

Inserts the provided proto::Track to this State.

Errors

Errors with PeerError::MediaConnections if sender::State creation fails.

pub fn patch_track(&self, track_patch: &TrackPatchEvent)[src]

Patches sender::State or receiver::State with the provided proto::TrackPatchEvent.

Schedules a local stream update.

#[must_use]pub fn current_sdp_offer(&self) -> Option<String>[src]

Returns the current SDP offer of this State.

Trait Implementations

impl AsProtoState for State[src]

type Output = Peer

medea_client_api_proto::state into which this state can be transformed. Read more

impl Debug for State[src]

impl SynchronizableState for State[src]

type Input = Peer

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

impl Updatable for State[src]

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

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]