Enum luminance::texture::TextureError
source · [−]#[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
Fields
expected_bytes: usize
Expected number of pixels in bytes.
provided_bytes: usize
Provided number of pixels in bytes.
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.
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
sourceimpl TextureError
impl TextureError
sourcepub fn texture_storage_creation_failed(reason: impl Into<String>) -> Self
pub fn texture_storage_creation_failed(reason: impl Into<String>) -> Self
A texture’s storage failed to be created.
sourcepub fn not_enough_pixels(expected_bytes: usize, provided_bytes: usize) -> Self
pub fn not_enough_pixels(expected_bytes: usize, provided_bytes: usize) -> Self
Not enough pixel data provided for the given area asked.
sourcepub fn unsupported_pixel_format(pf: PixelFormat) -> Self
pub fn unsupported_pixel_format(pf: PixelFormat) -> Self
Unsupported pixel format.
sourcepub fn cannot_retrieve_texels(reason: impl Into<String>) -> Self
pub fn cannot_retrieve_texels(reason: impl Into<String>) -> Self
Cannot retrieve texels from a texture.
sourcepub fn cannot_upload_texels(reason: impl Into<String>) -> Self
pub fn cannot_upload_texels(reason: impl Into<String>) -> Self
Failed to upload texels.
Trait Implementations
sourceimpl Clone for TextureError
impl Clone for TextureError
sourcefn clone(&self) -> TextureError
fn clone(&self) -> TextureError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TextureError
impl Debug for TextureError
sourceimpl Display for TextureError
impl Display for TextureError
sourceimpl Error for TextureError
impl Error for TextureError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl From<TextureError> for FramebufferError
impl From<TextureError> for FramebufferError
sourcefn from(e: TextureError) -> Self
fn from(e: TextureError) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<TextureError> for TextureError
impl PartialEq<TextureError> for TextureError
sourcefn eq(&self, other: &TextureError) -> bool
fn eq(&self, other: &TextureError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &TextureError) -> bool
fn ne(&self, other: &TextureError) -> bool
This method tests for !=
.
impl Eq for TextureError
impl StructuralEq for TextureError
impl StructuralPartialEq for TextureError
Auto Trait Implementations
impl RefUnwindSafe for TextureError
impl Send for TextureError
impl Sync for TextureError
impl Unpin for TextureError
impl UnwindSafe for TextureError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more