pub enum Error {
UnexpectedEof {
offset: usize,
needed: usize,
},
InvalidData(&'static str),
FileNotFound(String),
UnsupportedImage(String),
Image(ImageError),
BlpParse(LoadError),
BlpConvert(Error),
Io(Error),
FeatureRequired(&'static str),
Json(Error),
}Expand description
Errors produced while parsing map files or converting assets.
Variants§
UnexpectedEof
The input ended before a field could be fully read.
Fields
InvalidData(&'static str)
The input violated a structural invariant of the format.
FileNotFound(String)
A file was not found inside the MPQ archive.
UnsupportedImage(String)
A buffer could not be decoded as any supported image format.
Image(ImageError)
Raster decode/encode error from the image crate.
BlpParse(LoadError)
BLP parsing error.
BlpConvert(Error)
BLP-to-raster conversion error.
Io(Error)
I/O error (also covers MPQ archive access).
FeatureRequired(&'static str)
The operation needs a crate feature that is disabled.
Json(Error)
JSON serialization error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<ImageError> for Error
impl From<ImageError> for Error
Source§fn from(source: ImageError) -> Self
fn from(source: ImageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more