InError

Type Alias InError 

Source
pub type InError = ErrorType<char>;
Expand description

Input error

See ErrorType for details

Aliased Type§

pub enum InError {
    StdIO(Error),
    ShortIO {
        bytes: usize,
        expected: usize,
    },
    InvalidByte(char),
}

Variants§

§

StdIO(Error)

I/O error

Wraps a std::io::Error

§

ShortIO

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)

Fields

§bytes: usize
§expected: usize
§

InvalidByte(char)

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.