#[non_exhaustive]pub enum WebPError {
EncoderSetupFailed,
EncodeFailed,
EncodeFailedWithCode {
error_code: String,
},
InvalidDimension {
name: &'static str,
value: u32,
max: u32,
},
InvalidFrameDimensions {
width: u32,
height: u32,
max: u32,
},
EmptyAnimation,
FrameExceedsCanvas {
index: usize,
frame_width: u32,
frame_height: u32,
canvas_width: u32,
canvas_height: u32,
},
MixedFrameDimensions,
InvalidEncodedData,
ContainerSizeOverflow,
}Expand description
Structured errors raised by the WebP encoding and container assembly paths.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
EncoderSetupFailed
Encoder setup failed before actual frame encoding.
EncodeFailed
Encoding failed.
EncodeFailedWithCode
Encoding failed with a libwebp error code.
InvalidDimension
A named dimension exceeded the supported WebP 24-bit range.
Fields
InvalidFrameDimensions
The animation frame size exceeded the supported WebP 24-bit range.
Fields
EmptyAnimation
An animated encode was requested without any frames.
FrameExceedsCanvas
A frame exceeded the dimensions of the animation canvas.
Fields
MixedFrameDimensions
Animated frames did not all share the same dimensions.
InvalidEncodedData
Encoded data cannot be parsed as the expected WebP structure.
ContainerSizeOverflow
Internal WebP container size calculations exceeded supported limits.
Trait Implementations§
Source§impl Error for WebPError
impl Error for WebPError
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()
Auto Trait Implementations§
impl Forget for WebPError
impl Freeze for WebPError
impl Move for WebPError
impl RefUnwindSafe for WebPError
impl Send for WebPError
impl Sync for WebPError
impl Unpin for WebPError
impl UnsafeUnpin for WebPError
impl UnwindSafe for WebPError
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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