pub struct Coupling { /* private fields */ }Expand description
Two confirmed calls owned and driven as one.
Implementations§
Source§impl Coupling
impl Coupling
Sourcepub fn bridge_media(&mut self) -> bool
pub fn bridge_media(&mut self) -> bool
Attach the existing channel-based media bridge.
Without this call the coupling is signalling-only. Calling it again replaces the bridge after a renegotiation moved either session.
Sourcepub fn has_media_bridge(&self) -> bool
pub fn has_media_bridge(&self) -> bool
Whether this coupling currently forwards media.
Sourcepub fn state(&self) -> &CouplingState
pub fn state(&self) -> &CouplingState
The offer/answer policy, for an early-dialog driver or application adapter.
Sourcepub fn state_mut(&mut self) -> &mut CouplingState
pub fn state_mut(&mut self) -> &mut CouplingState
Mutably borrow the offer/answer policy while retaining ownership of both calls.
Sourcepub fn calls(&self) -> (&Call, &Call)
pub fn calls(&self) -> (&Call, &Call)
Borrow the calls for inspection without transferring either one out.
Sourcepub async fn run(
&mut self,
one_incoming: &mut Receiver<Incoming>,
two_incoming: &mut Receiver<Incoming>,
) -> Result<CouplingEnd>
pub async fn run( &mut self, one_incoming: &mut Receiver<Incoming>, two_incoming: &mut Receiver<Incoming>, ) -> Result<CouplingEnd>
Drive both routed inboxes until either dialog ends.
A BYE is first handled on the receiving leg (including its 200), then mapped to a BYE on the peer. Closing an inbox is terminal too: returning while leaving its peer alive would orphan a dialog the coupling still owns.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Coupling
impl !RefUnwindSafe for Coupling
impl Send for Coupling
impl Sync for Coupling
impl Unpin for Coupling
impl UnsafeUnpin for Coupling
impl !UnwindSafe for Coupling
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
§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