[][src]Enum luminance::texture::TextureError

#[non_exhaustive]pub enum TextureError {
    TextureStorageCreationFailed(String),
    NotEnoughPixels {
        expected_bytes: usize,
        provided_bytes: usize,
    },
    UnsupportedPixelFormat(PixelFormat),
    CannotRetrieveTexels(String),
    CannotUploadTexels(String),
}

Errors that might happen when working with textures.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
TextureStorageCreationFailed(String)

A texture’s storage failed to be created.

The carried String gives the reason of the failure.

NotEnoughPixels

Not enough pixel data provided for the given area asked.

You must provide at least as many pixels as expected by the area in the texture you’re uploading to.

Fields of NotEnoughPixels

expected_bytes: usize

Expected number of pixels in bytes.

provided_bytes: usize

Provided number of pixels in bytes.

UnsupportedPixelFormat(PixelFormat)

Unsupported pixel format.

Sometimes, some hardware might not support a given pixel format (or the format exists on the interface side but doesn’t in the implementation). That error represents such a case.

CannotRetrieveTexels(String)

Cannot retrieve texels from a texture.

That error might happen on some hardware implementations if the user tries to retrieve texels from a texture that doesn’t support getting its texels retrieved.

CannotUploadTexels(String)

Failed to upload texels.

Implementations

impl TextureError[src]

pub fn texture_storage_creation_failed(reason: impl Into<String>) -> Self[src]

A texture’s storage failed to be created.

pub fn not_enough_pixels(expected_bytes: usize, provided_bytes: usize) -> Self[src]

Not enough pixel data provided for the given area asked.

pub fn unsupported_pixel_format(pf: PixelFormat) -> Self[src]

Unsupported pixel format.

pub fn cannot_retrieve_texels(reason: impl Into<String>) -> Self[src]

Cannot retrieve texels from a texture.

pub fn cannot_upload_texels(reason: impl Into<String>) -> Self[src]

Failed to upload texels.

Trait Implementations

impl Clone for TextureError[src]

impl Debug for TextureError[src]

impl Display for TextureError[src]

impl Eq for TextureError[src]

impl Error for TextureError[src]

impl From<TextureError> for FramebufferError[src]

impl PartialEq<TextureError> for TextureError[src]

impl StructuralEq for TextureError[src]

impl StructuralPartialEq for TextureError[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.