pub enum ErrorType<Byte> {
    StdIO(IOError),
    ShortIO {
        bytes: usize,
        expected: usize,
    },
    InvalidByte(Byte),
}
Expand description

Input/output error type

Variants

StdIO(IOError)

I/O error

Wraps a std::io::Error

ShortIO

Fields

bytes: usize
expected: usize

Short read/write error

Number of read/written bytes is less than expected according to the format: for example if input format is binary, number of input bytes must be a multiple of 8 (since 8 binary digits are needed to code a byte value); similarly, if output format is hexadecimal, writing a byte value must result in writing 2 bytes (since 2 hexadecimal digits are needed to code a byte value)

InvalidByte(Byte)

Invalid byte read or invalid byte value to write

According to expected input format, a char read from the input can be invalid: f.e. in case of binary format any character other than ‘0’ or ‘1’ is invalid. Depending on output format, not all possible byte values can be represented; f.e. in case of ASCII format only byte values less than 128 are valid.

Trait Implementations

Formats the value using the given formatter. Read more

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

Returns the argument unchanged.

Calls U::from(self).

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

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.