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
Leading 4 magic bytes don’t match when decoding
InvalidChannels
Invalid number of channels: expected 3 or 4
InvalidColorSpace
Invalid color space: expected 0 or 1
InvalidImageDimensions
Invalid image dimensions: can’t be empty or larger than 400Mp
InvalidImageLength
Image dimensions are inconsistent with image buffer length
OutputBufferTooSmall
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)
Generic I/O error from the wrapped reader/writer
Trait Implementations§
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<Infallible> for Error
impl From<Infallible> for Error
source§fn from(_: Infallible) -> Self
fn from(_: Infallible) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more