pub struct PathSet(pub Vec<Address>);Expand description
The proxies a registrar recorded as being on the path back to this contact (RFC 3327).
Held and reported, not routed on. RFC 3327 §5.1 is explicit that “the general operation of
the UA is to ignore the Path header field in the response” — the path vector exists so that
requests arriving at the registrar can be routed toward a UA behind a NAT, and it is the
registrar that walks it, not the UA. A UA that turned it into a pre-loaded route set would
be sending its own requests through proxies that never asked to carry them; the header for
that job is Service-Route (RFC 3608), which is a different list with different semantics.
What §5.1 does say it is for is inspection: “such inspection might allow the UA to detect intermediate proxies that have inappropriately added themselves”. That is only possible if the value survives, which is why it is kept rather than parsed and dropped.
Tuple Fields§
§0: Vec<Address>Implementations§
Source§impl PathSet
impl PathSet
Sourcepub fn hops(&self) -> &[Address]
pub fn hops(&self) -> &[Address]
The proxies, outermost first — the order they appeared in, which is the order a request travelling toward the UA would traverse them.
Sourcepub fn rendered(&self) -> Vec<String>
pub fn rendered(&self) -> Vec<String>
Each hop rendered back to the form it arrived in, for logging and for comparison.
Sourcepub fn hops_outside(&self, expected: &[&str]) -> Vec<String>
pub fn hops_outside(&self, expected: &[&str]) -> Vec<String>
Whether a proxy this side did not expect is on the path.
RFC 3327 §5.1 gives inspection as the UA’s reason to care: “such inspection might allow the UA to detect intermediate proxies that have inappropriately added themselves”. That judgement needs a policy the UA holds, so this asks the question and leaves the answer to the caller rather than inventing a trust rule here.
Sourcepub fn from_response(response: &Response) -> Self
pub fn from_response(response: &Response) -> Self
Read the path vector out of a REGISTER response.
Parsed rather than kept as text, and kept as [Address] rather than as a URI, because
the parameters are load-bearing: RFC 5626 §5.3 hangs the ob marker off a Path value,
and T-15 needs to read it. A path vector flattened to a list of URIs would be
syntactically fine and quietly useless for Outbound.
Trait Implementations§
impl Eq for PathSet
Auto Trait Implementations§
impl Freeze for PathSet
impl RefUnwindSafe for PathSet
impl Send for PathSet
impl Sync for PathSet
impl Unpin for PathSet
impl UnsafeUnpin for PathSet
impl UnwindSafe for PathSet
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