Enum toad_msg::msg::parse_error::MessageParseError
source · pub enum MessageParseError {
UnexpectedEndOfStream,
InvalidTokenLength(u8),
OptParseError(OptParseError),
PayloadTooLong(usize),
InvalidType(u8),
}
Expand description
Errors encounterable while parsing a message from bytes
Variants§
UnexpectedEndOfStream
Reached end of stream before parsing was finished
InvalidTokenLength(u8)
Token length was > 8
OptParseError(OptParseError)
Error parsing option
PayloadTooLong(usize)
The rest of the message contained more bytes than there was capacity for
InvalidType(u8)
The message type is invalid (see Type
for information & valid values)
Implementations§
source§impl MessageParseError
impl MessageParseError
sourcepub fn eof() -> Self
pub fn eof() -> Self
Shorthand for MessageParseError::UnexpectedEndOfStream
Trait Implementations§
source§impl Clone for MessageParseError
impl Clone for MessageParseError
source§fn clone(&self) -> MessageParseError
fn clone(&self) -> MessageParseError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MessageParseError
impl Debug for MessageParseError
source§impl Ord for MessageParseError
impl Ord for MessageParseError
source§fn cmp(&self, other: &MessageParseError) -> Ordering
fn cmp(&self, other: &MessageParseError) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<MessageParseError> for MessageParseError
impl PartialEq<MessageParseError> for MessageParseError
source§fn eq(&self, other: &MessageParseError) -> bool
fn eq(&self, other: &MessageParseError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<MessageParseError> for MessageParseError
impl PartialOrd<MessageParseError> for MessageParseError
source§fn partial_cmp(&self, other: &MessageParseError) -> Option<Ordering>
fn partial_cmp(&self, other: &MessageParseError) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more