#[non_exhaustive]pub enum TextureError {
TextureStorageCreationFailed(String),
NotEnoughPixels {
expected_bytes: usize,
provided_bytes: usize,
},
UnsupportedPixelFormat(PixelFormat),
CannotRetrieveTexels(String),
CannotUploadTexels(String),
}Expand description
Errors that might happen when working with textures.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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
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§
Source§impl TextureError
impl TextureError
Sourcepub fn texture_storage_creation_failed(
reason: impl Into<String>,
) -> TextureError
pub fn texture_storage_creation_failed( reason: impl Into<String>, ) -> TextureError
A texture’s storage failed to be created.
Sourcepub fn not_enough_pixels(
expected_bytes: usize,
provided_bytes: usize,
) -> TextureError
pub fn not_enough_pixels( expected_bytes: usize, provided_bytes: usize, ) -> TextureError
Not enough pixel data provided for the given area asked.
Sourcepub fn unsupported_pixel_format(pf: PixelFormat) -> TextureError
pub fn unsupported_pixel_format(pf: PixelFormat) -> TextureError
Unsupported pixel format.
Sourcepub fn cannot_retrieve_texels(reason: impl Into<String>) -> TextureError
pub fn cannot_retrieve_texels(reason: impl Into<String>) -> TextureError
Cannot retrieve texels from a texture.
Sourcepub fn cannot_upload_texels(reason: impl Into<String>) -> TextureError
pub fn cannot_upload_texels(reason: impl Into<String>) -> TextureError
Failed to upload texels.
Trait Implementations§
Source§impl Clone for TextureError
impl Clone for TextureError
Source§fn clone(&self) -> TextureError
fn clone(&self) -> TextureError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more