pub enum DescriptorError {
    NotEnoughData {
        tag: u8,
        actual: usize,
        expected: usize,
    },
    TagTooLongForBuffer {
        taglen: usize,
        buflen: usize,
    },
    BufferTooShort {
        buflen: usize,
    },
    UnhandledTagValue(u8),
}
Expand description

An error during parsing of a descriptor

Variants§

§

NotEnoughData

Fields

§tag: u8

descriptor tag value

§actual: usize

actual buffer size

§expected: usize

expected buffer size

The amount of data available in the buffer is not enough to hold the descriptor’s declared size.

§

TagTooLongForBuffer

Fields

§taglen: usize

actual length in descriptor header

§buflen: usize

remaining bytes in buffer (which is seen to be shorter than taglen)

TODO: replace with NotEnoughData

§

BufferTooShort

Fields

§buflen: usize

the actual buffer length

The buffer is too short to even hold the two bytes of generic descriptor header data

§

UnhandledTagValue(u8)

There is no mapping defined of the given descriptor tag value to a Descriptor value.

Trait Implementations§

source§

impl Debug for DescriptorError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for DescriptorError

source§

fn eq(&self, other: &DescriptorError) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for DescriptorError

source§

impl StructuralPartialEq for DescriptorError

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.