pub enum Error {
Format {
detail: String,
position: Option<u64>,
},
Limits {
which: &'static str,
limit: u64,
actual: u64,
},
Decompress(&'static str),
Unsupported {
what: String,
},
Io(String),
ImageIo(String),
Internal(&'static str),
}Expand description
Every fallible library operation returns this.
Variants§
Format
The file/stream is structurally invalid for its claimed magic:
bad magic, impossible dims, tile_count mismatch, truncated records,
dangling/shape-mismatched references, invalid transform, reserved
bits/backend set, trailing bytes, decompressed-size violation.
detail is human-only (never parsed); position is the byte or tile
index where validation failed when known.
Fields
Limits
The stream is structurally plausible but claims more bytes/pixels/
tiles than the configured DecodeLimits allow.
Fields
Decompress(&'static str)
Decompression failed (corrupt zlib/zstd stream, bad checksum).
Unsupported
Container/backend/feature not supported by this build (reserved backend, feature-gated coder compiled out).
Io(String)
I/O failure reading the input or writing the output PNG.
ImageIo(String)
Image I/O (decode-to-RGB8 of a JPEG/PNG source, PNG encode).
Internal(&'static str)
Internal invariant that the library treats as unreachable (should never surface to callers; a bug if it does).
Implementations§
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()