fn updated_prefix(parameters: &[KeyValuePair]) -> Option<TrackNamespace>Expand description
The Track Namespace Prefix a REQUEST_UPDATE asks a namespace subscription
to move to, and None when it asks for no such move.
Section 10.2.14: “The TRACK_NAMESPACE_PREFIX parameter (Parameter Type 0x34) uses the Track Namespace encoding described in Section 2.4.1. It MAY appear in REQUEST_UPDATE for a SUBSCRIBE_NAMESPACE or SUBSCRIBE_TRACKS request. It updates the Track Namespace Prefix for that subscription.”
A prefix of no fields is a value rather than a removal. Section 2.4.1 puts a Track Namespace at “between 0 and 32 Track Namespace Fields”, an empty prefix selects every namespace, and Section 10.9 leaves no other reading open: “There is no mechanism to remove a parameter from a request.”
The last one wins when a message carries the parameter twice. That is the rule Section 10.9 gives for two messages – “Parameter values from later REQUEST_UPDATE messages override values from earlier ones” – applied inside one, which is the only reading under which a repeat means anything.
A value that is not a whole Track Namespace answers None, so an update
carrying one leaves the prefix where it was. The decoder that built the
message has already refused a malformed one; this is the arm that keeps a
hand-built message from moving a subscription to half a prefix.