pub fn validate_client_setup(msg: &ClientSetup) -> Result<(), SetupError>Expand description
Validate a CLIENT_SETUP message.
Section 6.2.2.3 puts no role restriction on MAX_SUBSCRIBE_ID: it “communicates an initial value for the Maximum Subscribe ID to the receiving subscriber”, which is something either endpoint may do, and a client that grants the server a subscribe budget during setup is doing exactly that. PATH is the restricted parameter, and it belongs to the client, so a CLIENT_SETUP is where it is legal.
ROLE is a different matter: Section 6.2.2.1 requires it of both endpoints, so its absence is refused here rather than defaulted.
§Errors
SetupError::EmptyVersionList if no version is offered.
SetupError::MissingParameter if no ROLE is present, and
SetupError::InvalidRole if its value is not one the draft assigns.