pub enum Role {
Controlling,
Controlled,
}Expand description
Which end decides (§6.1.1).
Variants§
Controlling
Responsible for nominating the pairs that become the selected pairs.
Controlled
Answers checks and follows the controlling agent’s nomination.
Implementations§
Source§impl Role
impl Role
Sourcepub const fn determine(offerer: bool, remote_lite: bool) -> Self
pub const fn determine(offerer: bool, remote_lite: bool) -> Self
§6.1.1’s role determination, for an agent that is always full (spec §12).
Both full: the initiating agent controls. Full against lite: the full agent controls,
unconditionally — which is why the peer’s a=ice-lite is an input here and not a detail
for the driver.
“The offerer controls” is the right answer and the wrong mechanism: two agents can both believe they offered — third-party call control, glare, a re-INVITE crossing — and two controlling agents never converge, because neither will accept the other’s nomination. §7.3.1.1 is what repairs that, and it is why this function is not the last word on the role.
Sourcepub const fn opposite(self) -> Self
pub const fn opposite(self) -> Self
The other role. A 487 switches to it (§7.2.5.1), as does the losing side of §7.3.1.1.
Sourcepub const fn is_controlling(self) -> bool
pub const fn is_controlling(self) -> bool
Whether this is the controlling role.
Trait Implementations§
impl Copy for Role
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more