Skip to main content

prefixes_overlap

Function prefixes_overlap 

Source
fn prefixes_overlap(a: &[Vec<u8>], b: &[Vec<u8>]) -> bool
Expand description

Whether two namespace prefixes overlap.

Section 6.13: “A subscriber cannot make overlapping namespace subscriptions on a single session. Within a session, if a publisher receives a SUBSCRIBE_ANNOUNCES with a Track Namespace Prefix that is a prefix of an earlier SUBSCRIBE_ANNOUNCES or vice versa, it MUST respond with SUBSCRIBE_ANNOUNCES_ERROR, with error code SUBSCRIBE_ANNOUNCES_OVERLAP.”

A namespace matches a namespace subscription when the subscription’s prefix is a prefix of it, so two prefixes select overlapping sets of namespaces exactly when one of them is a prefix of the other. Equal prefixes are that case as well: every prefix is a prefix of itself, and two equal ones select the same set.