pub struct ServiceRoute(pub Vec<Address>);Expand description
The proxies a registrar says this UA’s own requests must traverse (RFC 3608).
The opposite direction from PathSet, and — unlike Path — this one is the UA’s to act
on. RFC 3608 §6: the route “applies only to requests originating in the user agent”, and §6.1
has the UA “use the content of the Service-Route header field as a preloaded Route header
field in outgoing initial requests”. Without it, a request sipx sends goes straight at the
destination and arrives at a proxy holding no state for the registration it belongs to.
Order is normative: §6.1 requires a UA that exercises the route to “preserve the order” the values arrived in.
Tuple Fields§
§0: Vec<Address>Implementations§
Source§impl ServiceRoute
impl ServiceRoute
Sourcepub fn hops(&self) -> &[Address]
pub fn hops(&self) -> &[Address]
The proxies, in the order the registrar listed them — which is the order to traverse.
Sourcepub fn rendered(&self) -> Vec<String>
pub fn rendered(&self) -> Vec<String>
Each hop rendered as a Route header value, in order.
This is the form to preload: Route: <sip:proxy.example;lr>, one per hop.
Sourcepub fn from_response(response: &Response) -> Self
pub fn from_response(response: &Response) -> Self
Read the service route out of a REGISTER response.
Absent means empty, and empty means clear. RFC 3608 §6.1 says the stored value “is
updated according to the Service-Route header field of the latest 200 class response”,
and that “if there is no Service-Route header field in the response, the UA clears any
service route for that address-of-record previously stored”. Both rules are the same rule
— replace unconditionally — which is why this returns an empty set rather than an
Option a caller could mistake for “leave what you had”.
Sourcepub fn hops_without_loose_routing(&self) -> Vec<String>
pub fn hops_without_loose_routing(&self) -> Vec<String>
The hops the registrar sent without the ;lr parameter RFC 3608 §5 requires.
§5: values “MUST include the loose-routing indicator parameter ;lr”. A hop without it
asks for RFC 2543 strict routing, where each proxy rewrites the Request-URI — a mechanism
sipx does not implement and would be wrong to pretend to. Reported rather than rejected:
the offending party is the registrar, the request will still reach the proxy named, and a
UA that discarded the whole route set over a missing parameter would be unroutable for a
reason its operator could not see.
lr is a URI parameter — inside the angle brackets — not a header parameter after them.
Looking for it in the wrong list finds nothing and reports every hop, which is how this
method was wrong the first time it was written.
Trait Implementations§
Source§impl Clone for ServiceRoute
impl Clone for ServiceRoute
Source§fn clone(&self) -> ServiceRoute
fn clone(&self) -> ServiceRoute
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServiceRoute
impl Debug for ServiceRoute
Source§impl Default for ServiceRoute
impl Default for ServiceRoute
Source§fn default() -> ServiceRoute
fn default() -> ServiceRoute
Source§impl PartialEq for ServiceRoute
impl PartialEq for ServiceRoute
impl Eq for ServiceRoute
Auto Trait Implementations§
impl Freeze for ServiceRoute
impl RefUnwindSafe for ServiceRoute
impl Send for ServiceRoute
impl Sync for ServiceRoute
impl Unpin for ServiceRoute
impl UnsafeUnpin for ServiceRoute
impl UnwindSafe for ServiceRoute
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