enum DecoderError {
NoEntries,
IcoEntryTooManyPlanesOrHotspot,
IcoEntryTooManyBitsPerPixelOrHotspot,
PngShorterThanHeader,
PngNotRgba,
InvalidDataSize,
ImageEntryDimensionMismatch {
format: IcoEntryImageFormat,
entry: (u16, u16),
image: (u32, u32),
},
}
Expand description
Errors that can occur during decoding and parsing an ICO image or one of its enclosed images.
Variants§
NoEntries
The ICO directory is empty
IcoEntryTooManyPlanesOrHotspot
The number of color planes (0 or 1), or the horizontal coordinate of the hotspot for CUR files too big.
IcoEntryTooManyBitsPerPixelOrHotspot
The bit depth (may be 0 meaning unspecified), or the vertical coordinate of the hotspot for CUR files too big.
PngShorterThanHeader
The entry is in PNG format and specified a length that is shorter than PNG header.
PngNotRgba
The enclosed PNG is not in RGBA, which is invalid: https://blogs.msdn.microsoft.com/oldnewthing/20101022-00/?p=12473/.
InvalidDataSize
The entry is in BMP format and specified a data size that is not correct for the image and optional mask data.
ImageEntryDimensionMismatch
The dimensions specified by the entry does not match the dimensions in the header of the enclosed image.
Trait Implementations§
source§impl Clone for DecoderError
impl Clone for DecoderError
source§fn clone(&self) -> DecoderError
fn clone(&self) -> DecoderError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for DecoderError
impl Debug for DecoderError
source§impl Display for DecoderError
impl Display for DecoderError
source§impl Error for DecoderError
impl Error for DecoderError
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<DecoderError> for ImageError
impl From<DecoderError> for ImageError
source§fn from(e: DecoderError) -> ImageError
fn from(e: DecoderError) -> ImageError
Converts to this type from the input type.
source§impl Hash for DecoderError
impl Hash for DecoderError
source§impl Ord for DecoderError
impl Ord for DecoderError
source§fn cmp(&self, other: &DecoderError) -> Ordering
fn cmp(&self, other: &DecoderError) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for DecoderError
impl PartialEq for DecoderError
source§impl PartialOrd for DecoderError
impl PartialOrd for DecoderError
impl Copy for DecoderError
impl Eq for DecoderError
impl StructuralPartialEq for DecoderError
Auto Trait Implementations§
impl Freeze for DecoderError
impl RefUnwindSafe for DecoderError
impl Send for DecoderError
impl Sync for DecoderError
impl Unpin for DecoderError
impl UnwindSafe for DecoderError
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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