pub struct Redirect {
pub connect_uri: Vec<u8>,
pub track_namespace: TrackNamespace,
pub track_name: Vec<u8>,
}Expand description
The value of a REDIRECT Error Detail (Section 9.4.2.1).
REDIRECT Error Detail {
Type (vi64) = 0x01,
Length (vi64),
Connect URI Length (vi64),
Connect URI (..),
Track Namespace (..),
Track Name Length (vi64),
Track Name (..),
}The Track Name may be empty: “Track Name is not meaningful for namespace-scoped requests (SUBSCRIBE_NAMESPACE, PUBLISH_NAMESPACE, SUBSCRIBE_TRACKS) and MUST be empty”. Which request it answers is session state, so neither that rule nor the Connect URI’s ROLE_VIOLATION is checked here.
Fields§
§connect_uri: Vec<u8>§track_namespace: TrackNamespace§track_name: Vec<u8>Implementations§
Source§impl Redirect
impl Redirect
Sourcepub fn decode(value: &[u8]) -> Result<Self, CodecError>
pub fn decode(value: &[u8]) -> Result<Self, CodecError>
Read a REDIRECT Error Detail’s value.
A value that is not the structure above is
CodecError::MalformedErrorDetail. Section 8.3: “If a receiver
understands a Type, and the following Value or Length/Value does not
match the serialization defined by that Type, the receiver MUST close
the session with MALFORMED_KEY_VALUE.” The namespace’s own rules
(Section 8.7) keep their own errors.
Sourcepub fn encode(&self) -> Result<Vec<u8>, CodecError>
pub fn encode(&self) -> Result<Vec<u8>, CodecError>
The value of a REDIRECT Error Detail carrying this redirect.
Sourcepub fn to_error_detail(&self) -> Result<KeyValuePair, CodecError>
pub fn to_error_detail(&self) -> Result<KeyValuePair, CodecError>
This redirect as a REDIRECT Error Detail.