#[non_exhaustive]pub enum DecodeError {
Show 16 variants
Short,
Long,
InvalidString(FromUtf8Error),
InvalidMessage(u64),
InvalidSubscribeLocation,
InvalidValue,
TooMany,
BoundsExceeded,
ExpectedEnd,
MessageTooLarge {
size: usize,
max: usize,
},
Duplicate,
TrailingBytes,
Version,
Session(SessionError),
MalformedAuthToken,
MultipleAuthTokens,
}Expand description
A decode error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Short
The buffer ran out mid-value. Retry once more bytes arrive.
Long
The value claims more bytes than the enclosing message allows.
InvalidString(FromUtf8Error)
A string field was not valid UTF-8.
InvalidMessage(u64)
The message type ID is unknown for the negotiated version.
InvalidSubscribeLocation
A SUBSCRIBE start/end location is malformed or out of order.
InvalidValue
A field held a value outside its permitted range.
TooMany
A repeated field exceeded the count this implementation accepts.
BoundsExceeded
An integer was too large for the field it was read into.
ExpectedEnd
More data followed where the message was required to end.
MessageTooLarge
A length-prefixed message exceeded the receiver’s byte limit.
Fields
Duplicate
A parameter or field appeared more than once.
TrailingBytes
Bytes remained after the value was fully decoded.
Version
The field does not exist in the negotiated protocol version.
Session(SessionError)
The value is one the draft answers by closing the session with this code, such as an
AUTHORIZATION TOKEN naming an alias.
MalformedAuthToken
A request’s AUTHORIZATION TOKEN is well formed but unusable, such as a repeat of
another, which rejects the request rather than closing the session.
MultipleAuthTokens
A request carries more than one distinct AUTHORIZATION TOKEN, which this
implementation refuses as unsupported rather than closing the session.
Trait Implementations§
Source§impl Clone for DecodeError
impl Clone for DecodeError
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()