[][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 From<FromUtf8Error> for ReadError[src]

impl Display for ReadError[src]

impl Debug for ReadError[src]

impl Error for ReadError[src]

fn description(&self) -> &str
1.0.0
[src]

This method is soft-deprecated. Read more

fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0
[src]

The lower-level source of this error, if any. Read more

Auto Trait Implementations

impl Send for ReadError

impl Sync for ReadError

Blanket Implementations

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

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.