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
Fields
format: IcoEntryImageFormat
The mismatched subimage’s type
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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<DecoderError> for ImageError
impl From<DecoderError> for ImageError
source§fn from(e: DecoderError) -> ImageError
fn from(e: DecoderError) -> ImageError
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,
source§impl PartialEq<DecoderError> for DecoderError
impl PartialEq<DecoderError> for DecoderError
source§fn eq(&self, other: &DecoderError) -> bool
fn eq(&self, other: &DecoderError) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<DecoderError> for DecoderError
impl PartialOrd<DecoderError> for DecoderError
source§fn partial_cmp(&self, other: &DecoderError) -> Option<Ordering>
fn partial_cmp(&self, other: &DecoderError) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for DecoderError
impl Eq for DecoderError
impl StructuralEq for DecoderError
impl StructuralPartialEq for DecoderError
Auto Trait Implementations§
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
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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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