pub struct Calls(/* private fields */);Expand description
The set of calls a dispatcher routes to: a cheap, cloneable handle to its routing table.
Needed because the dispatcher’s loop and the code that places outbound calls are not the same
task. A call made with dial is registered through this from wherever it was
dialled; an inbound one needs nothing, because Dispatcher::next reserved its route before
the application ever saw the INVITE.
Implementations§
Source§impl Calls
impl Calls
Sourcepub fn register(&self, dialog: &Dialog) -> Receiver<Incoming>
pub fn register(&self, dialog: &Dialog) -> Receiver<Incoming>
Route this dialog’s in-dialog requests to the returned inbox.
Hand the inbox to serve. Dropping it — which is what ending a call and
returning from serve does — releases the route.
There is a window on the outbound path this cannot close: dial returns
only once the 2xx has arrived, so a BYE that overtakes it is answered 481. Closing it
needs the Call-ID to be known before the INVITE is sent, which is a change to dial
this story does not make.
Registering a dialog that already has a route replaces it, and the previous inbox stops receiving.
Sourcepub fn forget(&self, dialog: &Dialog)
pub fn forget(&self, dialog: &Dialog)
Stop routing to this dialog.
Rarely needed — dropping the inbox does the same thing lazily — but explicit when an application tears a call down without dropping the receiver it was serving from.
Sourcepub fn counts(&self) -> DispatchCounts
pub fn counts(&self) -> DispatchCounts
What has been refused, shed or left unplaced.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Calls
impl !RefUnwindSafe for Calls
impl Send for Calls
impl Sync for Calls
impl Unpin for Calls
impl UnsafeUnpin for Calls
impl !UnwindSafe for Calls
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<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