Enum toad_msg::msg::opt::parse_error::OptParseError
source · pub enum OptParseError {
UnexpectedEndOfStream,
OptionValueTooLong {
capacity: usize,
actual: usize,
},
TooManyOptions(usize),
OptionDeltaReservedValue(u8),
ValueLengthReservedValue(u8),
OptionsExhausted,
}
Expand description
Errors encounterable while parsing an option from bytes
Variants§
UnexpectedEndOfStream
Reached end of stream before parsing was finished
OptionValueTooLong
Option value was longer than the fixed capacity
TooManyOptions(usize)
Parsed more options than reserved capacity
OptionDeltaReservedValue(u8)
Option Delta was set to 15, which is invalid.
ValueLengthReservedValue(u8)
Value Length was set to 15, which is invalid.
OptionsExhausted
Not a true failure case; only means we tried to read the payload marker byte (0xFF) as an option header.
Implementations§
source§impl OptParseError
impl OptParseError
sourcepub fn eof() -> Self
pub fn eof() -> Self
Shorthand for OptParseError::UnexpectedEndOfStream
Trait Implementations§
source§impl Clone for OptParseError
impl Clone for OptParseError
source§fn clone(&self) -> OptParseError
fn clone(&self) -> OptParseError
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 OptParseError
impl Debug for OptParseError
source§impl Ord for OptParseError
impl Ord for OptParseError
source§fn cmp(&self, other: &OptParseError) -> Ordering
fn cmp(&self, other: &OptParseError) -> 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<OptParseError> for OptParseError
impl PartialEq<OptParseError> for OptParseError
source§fn eq(&self, other: &OptParseError) -> bool
fn eq(&self, other: &OptParseError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<OptParseError> for OptParseError
impl PartialOrd<OptParseError> for OptParseError
source§fn partial_cmp(&self, other: &OptParseError) -> Option<Ordering>
fn partial_cmp(&self, other: &OptParseError) -> 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