Enum Error

pub enum Error

Denotes invalid flat sample buffers when trying to convert to stricter types.

The biggest use case being ImageBuffer which expects closely packed samples in a row major matrix representation. But this error type may be reused for other import functions. A more versatile user may also try to correct the underlying representation depending on the error variant.

Variants

TooLarge

The represented image was too large.

The optional value denotes a possibly accepted maximal bound.

NormalFormRequired(NormalForm)

The represented image can not use this representation.

Has an additional value of the normalized form that would be accepted.

ChannelCountMismatch(u8, u8)

The color format did not match the channel count.

In some cases you might be able to fix this by lowering the reported pixel count of the buffer without touching the strides.

In very special circumstances you may do the opposite. This is VERY dangerous but not directly memory unsafe although that will likely alias pixels. One scenario is when you want to construct an Rgba image but have only 3 bytes per pixel and for some reason don't care about the value of the alpha channel even though you need Rgba.

WrongColor(ColorType)

Deprecated - ChannelCountMismatch is used instead

Trait Implementations

impl Clone for Error

fn clone(&self) -> Self

impl Copy for Error

impl Debug for Error

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

impl Display for Error

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

impl Eq for Error

impl Error for Error

impl Hash for Error

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for Error

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for Error

Auto Trait Implementations

impl Freeze for Error

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnsafeUnpin for Error

impl UnwindSafe for Error

Blanket Implementations

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

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

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

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

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

impl<T> CloneToUninit for Error where T: Clone,

impl<T> From<T> for Error

impl<T> IntoEither for Error

impl<T> Pointable for Error

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

impl<T> ToOwned for Error where T: Clone,

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

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

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

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