pub struct Gruus { /* private fields */ }Expand description
The GRUUs a registrar issued for one instance’s binding (§4.2, §5.2).
Held with the registration rather than beside it, and replaced wholesale on every 2xx. That
is not tidiness: §4.2 requires a UA to “discard all temporary GRUUs learned through prior
REGISTER responses” whenever the Call-ID changes, and a set that is replaced rather than
merged cannot carry a stale one across.
Implementations§
Source§impl Gruus
impl Gruus
Sourcepub fn from_response(response: &Response, instance: &InstanceId) -> Self
pub fn from_response(response: &Response, instance: &InstanceId) -> Self
Read the GRUUs a REGISTER 2xx issued for instance (§4.2).
§4.2 pairs the two parameters with the Contact carrying the +sip.instance they were
minted for — and a 2xx lists every current binding for the address of record, other
devices’ included (RFC 3261 §10.3). Selecting the row by instance rather than by position
is what stops this adopting another phone’s GRUU and then answering to it.
A value that is not a GRUU is dropped rather than kept. §7 gives a GRUU the gr
parameter, and a URI without one is the address of record: using it as though it named
this instance would route every one of the user’s devices at a request meant for one.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the registrar issued neither.
§4.2: “A UA must be prepared for a Contact to contain just one, both, or neither” — a registrar that does not implement RFC 5627 answers a REGISTER perfectly well and attaches nothing, and that is not an error.
Sourcepub fn preferred(&self, kind: Kind) -> Option<&Uri>
pub fn preferred(&self, kind: Kind) -> Option<&Uri>
The GRUU to use for a caller that asked for kind (§4.4).
One never stands in for the other. Asking for a temporary GRUU and being handed the
public one would tell the caller the opposite of the truth about what it just put in a
Contact: it believes it published an address nobody can correlate, and it published the
device’s permanent name. None — falling back to the ordinary contact — is the honest
answer, and it is the one that leaks least.
Trait Implementations§
Source§impl PartialEq for Gruus
Compared by what the two URIs say, because [Uri] deliberately has no PartialEq: RFC 3261
§19.1.4 equivalence is not transitive, and it is the wrong relation here anyway — two
registrations that returned different spellings of one GRUU did return different values.
impl PartialEq for Gruus
Compared by what the two URIs say, because [Uri] deliberately has no PartialEq: RFC 3261
§19.1.4 equivalence is not transitive, and it is the wrong relation here anyway — two
registrations that returned different spellings of one GRUU did return different values.
impl Eq for Gruus
Auto Trait Implementations§
impl !Freeze for Gruus
impl RefUnwindSafe for Gruus
impl Send for Gruus
impl Sync for Gruus
impl Unpin for Gruus
impl UnsafeUnpin for Gruus
impl UnwindSafe for Gruus
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