Enum ImageError

pub enum ImageError

The generic error type for image operations.

This high level enum allows, by variant matching, a rough separation of concerns between underlying IO, the caller, format specifications, and the image implementation.

Variants

Decoding(DecodingError)

An error was encountered while decoding.

This means that the input data did not conform to the specification of some image format, or that no format could be determined, or that it did not match format specific requirements set by the caller.

Encoding(EncodingError)

An error was encountered while encoding.

The input image can not be encoded with the chosen format, for example because the specification has no representation for its color space or because a necessary conversion is ambiguous. In some cases it might also happen that the dimensions can not be used with the format.

Parameter(ParameterError)

An error was encountered in input arguments.

This is a catch-all case for strictly internal operations such as scaling, conversions, etc. that involve no external format specifications.

Limits(LimitError)

Completing the operation would have required more resources than allowed.

Errors of this type are limits set by the user or environment, not inherent in a specific format or operation that was executed.

Unsupported(UnsupportedError)

An operation can not be completed by the chosen abstraction.

This means that it might be possible for the operation to succeed in general but

  • it requires a disabled feature,
  • the implementation does not yet exist, or
  • no abstraction for a lower level could be found.
IoError(Error)

An error occurred while interacting with the environment.

Trait Implementations

impl Debug for ImageError

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Display for ImageError

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

impl Error for ImageError

fn source(&self) -> Option<&dyn Error + 'static>

impl From<Error> for ImageError

fn from(error: Error) -> ImageError

impl From<Error> for ImageError

fn from(err: Error) -> ImageError

impl From<TryFromExtendedColorError> for ImageError

fn from(err: TryFromExtendedColorError) -> ImageError

impl From<TryReserveError> for ImageError

fn from(TryReserveError) -> ImageError

Auto Trait Implementations

impl !RefUnwindSafe for ImageError

impl !UnwindSafe for ImageError

impl Freeze for ImageError

impl Send for ImageError

impl Sync for ImageError

impl Unpin for ImageError

impl UnsafeUnpin for ImageError

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for ImageError where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for ImageError where ST: ?Sized, DT: ?Sized,

impl<T> Any for ImageError where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for ImageError where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for ImageError where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for ImageError

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> IntoEither for ImageError

impl<T> Pointable for ImageError

const ALIGN: usize = _;
type Init = T;
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)

impl<T> Read<Exclusive, BecauseExclusive> for ImageError where T: ?Sized,

impl<T> ToString for ImageError where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for ImageError where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for ImageError where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for ImageError where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>