#[non_exhaustive]pub enum Error {
NotWebp,
Truncated,
MissingImage,
InvalidBitstream {
codec: Codec,
},
InvalidDimensions,
PixelBufferMismatch,
UnsupportedFeature,
InvalidContainer,
LimitExceeded {
pixels: u64,
limit: u64,
},
Io(ErrorKind),
}Expand description
Errors returned by the WebP codecs (VP8L lossless, VP8 lossy) and this shell crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotWebp
The input is not a well-formed WebP file (bad RIFF/WEBP magic).
Truncated
The input ended in the middle of a header, chunk, or bitstream.
MissingImage
The file contains no image chunk (VP8L or VP8) that this crate can decode.
InvalidBitstream
The input is not a well-formed WebP bitstream; codec names which
bitstream (VP8L lossless or VP8 lossy) failed to parse — a bad Huffman
stream / transform for Lossless, or a bad frame tag / key-frame start
code / dimensions for Lossy.
InvalidDimensions
A requested width or height is 0 or exceeds the VP8L maximum of 16384
(the crate-internal MAX_DIMENSION).
PixelBufferMismatch
The pixel buffer length does not equal width * height * 4 bytes.
UnsupportedFeature
A well-formed WebP that uses a feature this build does not decode.
InvalidContainer
The extended (VP8X) container or one of its chunks is malformed.
LimitExceeded
The image’s pixel count exceeds a caller-supplied decode limit; reported before any large allocation so a hostile header cannot exhaust memory.
Io(ErrorKind)
An I/O error from a std::io::Read/std::io::Write source. The
std::io::ErrorKind is retained; the original message is not.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more