[][src]Enum bitstream_reader::ReadError

pub enum ReadError {
    TooManyBits {
        requested: usize,
        max: usize,
    },
    NotEnoughData {
        requested: usize,
        bits_left: usize,
    },
    IndexOutOfBounds {
        pos: usize,
        size: usize,
    },
    UnmatchedDiscriminant {
        discriminant: usize,
        enum_name: String,
    },
    Utf8Error(FromUtf8Error),
}

Errors that can be returned when trying to read from a buffer

Variants

TooManyBits

Too many bits requested to fit in the requested data type

Fields of TooManyBits

requested: usize

The number of bits requested to read

max: usize

The number of bits that fit in the requested data type

NotEnoughData

Not enough data in the buffer to read all requested bits

Fields of NotEnoughData

requested: usize

The number of bits requested to read

bits_left: usize

the number of bits left in the buffer

IndexOutOfBounds

The requested position is outside the bounds of the stream or buffer

Fields of IndexOutOfBounds

pos: usize

The requested position

size: usize

the number of bits in the buffer

UnmatchedDiscriminant

Unmatched discriminant found while trying to read an enum

Fields of UnmatchedDiscriminant

discriminant: usize

The read discriminant

enum_name: String

The name of the enum that is trying to be read

Utf8Error(FromUtf8Error)

The read slice of bytes are not valid utf8

Trait Implementations

impl Debug for ReadError[src]

impl Display for ReadError[src]

impl Error for ReadError[src]

impl From<FromUtf8Error> for ReadError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.