Enum toad_msg::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
sourceimpl OptParseError
impl OptParseError
sourcepub fn eof() -> Self
pub fn eof() -> Self
Shorthand for OptParseError::UnexpectedEndOfStream
Trait Implementations
sourceimpl Clone for OptParseError
impl Clone for OptParseError
sourcefn clone(&self) -> OptParseError
fn clone(&self) -> OptParseError
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for OptParseError
impl Debug for OptParseError
sourceimpl PartialEq<OptParseError> for OptParseError
impl PartialEq<OptParseError> for OptParseError
sourcefn eq(&self, other: &OptParseError) -> bool
fn eq(&self, other: &OptParseError) -> bool
sourceimpl PartialOrd<OptParseError> for OptParseError
impl PartialOrd<OptParseError> for OptParseError
sourcefn partial_cmp(&self, other: &OptParseError) -> Option<Ordering>
fn partial_cmp(&self, other: &OptParseError) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moreimpl Copy for OptParseError
impl StructuralPartialEq for OptParseError
Auto Trait Implementations
impl RefUnwindSafe for OptParseError
impl Send for OptParseError
impl Sync for OptParseError
impl Unpin for OptParseError
impl UnwindSafe for OptParseError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more