pub enum Error {
InvalidData {
byte_count: usize,
},
DimensionsMismatch {
width: u32,
height: u32,
pixel_count: usize,
},
OsError(Error),
}
Expand description
An error produced when using Icon::from_rgba
with invalid arguments.
Variants
InvalidData
Fields
byte_count: usize
The length of the provided RGBA data.
The provided RGBA data isn’t divisble by 4.
Therefore, it cannot be safely interpreted as 32bpp RGBA pixels.
DimensionsMismatch
Fields
width: u32
The provided width.
height: u32
The provided height.
pixel_count: usize
The amount of pixels of the provided RGBA data.
The number of RGBA pixels does not match the provided dimensions.
OsError(Error)
The underlying OS failed to create the icon.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
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>
🔬 This is a nightly-only experimental API. (
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
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
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
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