Struct medea_jason::peer::State [−][src]
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]
id: Id,
ice_servers: Vec<IceServer>,
force_relay: bool,
negotiation_role: Option<NegotiationRole>
) -> Self
Creates a new State
with the provided data.
#[must_use]pub fn id(&self) -> Id
[src]
#[must_use]pub fn ice_servers(&self) -> &Vec<IceServer>
[src]
#[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]
&self,
tracks_ids: HashSet<TrackId>
) -> LocalBoxFuture<'static, Result<(), Traced<PeerError>>>
Returns Future
resolving once
getUserMedia()/getDisplayMedia() request for the provided
TrackId
s 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
TrackId
s.
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]
&self,
track: &Track,
send_constraints: LocalTracksConstraints
) -> Result<(), Traced<PeerError>>
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
fn as_proto(&self) -> Self::Output
[src]
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.
fn from_proto(from: Self::Input, send_cons: &LocalTracksConstraints) -> Self
[src]
fn apply(&self, state: Self::Input, send_cons: &LocalTracksConstraints)
[src]
impl Updatable for State
[src]
fn when_stabilized(&self) -> AllProcessed<'static>
[src]
fn when_updated(&self) -> AllProcessed<'static>
[src]
fn connection_lost(&self)
[src]
fn connection_recovered(&self)
[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]
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.