[][src]Enum bitbuffer::BitError

pub enum BitError {
    TooManyBits {
        requested: usize,
        max: usize,
    },
    NotEnoughData {
        requested: usize,
        bits_left: usize,
    },
    IndexOutOfBounds {
        pos: usize,
        size: usize,
    },
    UnmatchedDiscriminant {
        discriminant: usize,
        enum_name: String,
    },
    Utf8Error(Utf8Errorusize),
    StringToLong {
        string_length: usize,
        requested_length: usize,
    },
}

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(Utf8Errorusize)

The read slice of bytes are not valid utf8

StringToLong

The string that was requested to be written does not fit in the specified fixed length

Fields of StringToLong

string_length: usize

Length of the string that was requested to be written

requested_length: usize

The requested fixed size to encode the string into

Trait Implementations

impl Debug for BitError[src]

impl Display for BitError[src]

impl Error for BitError[src]

impl From<FromUtf8Error> for BitError[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.