Enum qoi::Error[][src]

pub enum Error {
    InvalidMagic {
        magic: u32,
    },
    InvalidChannels {
        channels: u8,
    },
    InvalidColorSpace {
        colorspace: u8,
    },
    InvalidImageDimensions {
        width: u32,
        height: u32,
    },
    InvalidImageLength {
        size: usize,
        width: u32,
        height: u32,
    },
    OutputBufferTooSmall {
        size: usize,
        required: usize,
    },
    UnexpectedBufferEnd,
    InvalidPadding,
    IoError(Error),
}
Expand description

Errors that can occur during encoding or decoding.

Variants

InvalidMagic

Fields

magic: u32

Leading 4 magic bytes don’t match when decoding

InvalidChannels

Fields

channels: u8

Invalid number of channels: expected 3 or 4

InvalidColorSpace

Fields

colorspace: u8

Invalid color space: expected 0 or 1

InvalidImageDimensions

Fields

width: u32
height: u32

Invalid image dimensions: can’t be empty or larger than 400Mp

InvalidImageLength

Fields

size: usize
width: u32
height: u32

Image dimensions are inconsistent with image buffer length

OutputBufferTooSmall

Fields

size: usize
required: usize

Output buffer is too small to fit encoded/decoded image

UnexpectedBufferEnd

Input buffer ended unexpectedly before decoding was finished

InvalidPadding

Invalid stream end marker encountered when decoding

IoError(Error)

Tuple Fields

0: Error

Generic I/O error from the wrapped reader/writer

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

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

👎 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

Performs the conversion.

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.