pub enum Error {
InvalidFormat(Cow<'static, str>),
UnexpectedEndOfFile(Option<Cow<'static, str>>),
Io(Error),
}
Expand description
Library-specific error type which is returned by metadata loading operations.
Variants§
InvalidFormat(Cow<'static, str>)
Returned when metadata can’t be recovered because image format is invalid.
This error can be caused by broken file or when trying to load an image with an incorrect metadata decoder, e.g. trying to load PNG metadata from JPEG.
UnexpectedEndOfFile(Option<Cow<'static, str>>)
Returned when metadata can’t be recovered because of the sudden end of the image file.
Usually this error is caused by broken files, but it may also be cause by applying loose formats (like JPEG) to a different image type.
Io(Error)
Returned when an I/O error occurs when reading an input stream.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
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