[][src]Enum image::flat::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 resused for other import functions. A more versatile user may also try to correct the underlying representation depending on the error variant.



The represented image was too large.

The optional value denotes a possibly accepted maximal bound.


The represented image can not use this representation.

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


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.

Trait Implementations

impl Clone for Error[src]

impl Copy for Error[src]

impl Debug for Error[src]

impl Display for Error[src]

impl Eq for Error[src]

impl Error for Error[src]

impl From<Error> for ImageError[src]

impl Hash for Error[src]

impl PartialEq<Error> for Error[src]

impl StructuralEq for Error[src]

impl StructuralPartialEq for Error[src]

Auto Trait Implementations

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.