Enum bitbuffer::BitError[][src]

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,
    },
}
Expand description

Errors that can be returned when trying to read from or write to 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

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

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

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.