#[non_exhaustive]pub enum MoshError {
DecodingError(DecodingError),
EncodingError(EncodingError),
InvalidPalette,
IoError(Error),
ConversionError(TryFromIntError),
RngError(Error),
OutOfMemory,
}
Expand description
It handles internal, I/O and formatter errors
Variants (Non-exhaustive)§
This enum is marked as 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.
DecodingError(DecodingError)
Data format is not supported.
EncodingError(EncodingError)
i.e. wrong data size/formatter failure.
InvalidPalette
Image palette issue.
IoError(Error)
I/O errors.
ConversionError(TryFromIntError)
Out of range errors,
RngError(Error)
Probability distribution errors.
OutOfMemory
Allocation failed.
Trait Implementations§
Source§impl Error for MoshError
impl Error for MoshError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<DecodingError> for MoshError
impl From<DecodingError> for MoshError
Source§fn from(e: DecodingError) -> Self
fn from(e: DecodingError) -> Self
Converts to this type from the input type.
Source§impl From<EncodingError> for MoshError
impl From<EncodingError> for MoshError
Source§fn from(e: EncodingError) -> Self
fn from(e: EncodingError) -> Self
Converts to this type from the input type.
Source§impl From<TryFromIntError> for MoshError
impl From<TryFromIntError> for MoshError
Source§fn from(e: TryFromIntError) -> Self
fn from(e: TryFromIntError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MoshError
impl !RefUnwindSafe for MoshError
impl Send for MoshError
impl Sync for MoshError
impl Unpin for MoshError
impl !UnwindSafe for MoshError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more